Package net.devh.boot.grpc.server.advice
package net.devh.boot.grpc.server.advice
-
ClassDescriptionSpecial
@Component
to declare global gRPC exception handling.A discovery class to find all Beans annotated with@GrpcAdvice
and for all found beans a second search is performed looking for methods with@GrpcExceptionHandler
.As part of@GrpcAdvice
, when a thrown exception is caught during gRPC calls (via global interceptorGrpcExceptionInterceptor
), then this thrown exception is being handled.Condition to check if@GrpcAdvice
is present.Methods annotated with@GrpcExceptionHandler
are being mapped to a corresponding Exception, by declaring either in@GrpcExceptionHandler(value = ...)
as value or as annotated methods parameter (both is working too).Given an annotated@GrpcAdvice
class and annotated methods with@GrpcExceptionHandler
,GrpcExceptionHandlerMethodResolver
resolves given exception type and maps it to the corresponding method to be executed, when this exception is being raised.