Package net.devh.boot.grpc.server.advice
package net.devh.boot.grpc.server.advice
-
ClassDescriptionSpecial
@Componentto declare global gRPC exception handling.A discovery class to find all Beans annotated with@GrpcAdviceand 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@GrpcAdviceis present.Methods annotated with@GrpcExceptionHandlerare 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@GrpcAdviceclass and annotated methods with@GrpcExceptionHandler,GrpcExceptionHandlerMethodResolverresolves given exception type and maps it to the corresponding method to be executed, when this exception is being raised.