public class GrpcExceptionHandlerMethodResolver extends Object implements InitializingBean
@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.
For an example how to make use of it, please have a look at @GrpcExceptionHandler.
GrpcAdvice,
GrpcExceptionHandler,
GrpcAdviceExceptionHandler| Constructor and Description |
|---|
GrpcExceptionHandlerMethodResolver(GrpcAdviceDiscoverer grpcAdviceDiscoverer)
Creates a new GrpcExceptionHandlerMethodResolver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
<E extends Throwable> |
isMethodMappedForException(Class<E> exception)
Lookup if a method is mapped to given exception.
|
<E extends Throwable> |
resolveMethodWithInstance(Class<E> exceptionType)
When given exception type is subtype of already provided mapped exception, this returns a valid mapped method to
be later executed.
|
public GrpcExceptionHandlerMethodResolver(GrpcAdviceDiscoverer grpcAdviceDiscoverer)
grpcAdviceDiscoverer - The advice discoverer to use.public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanException@NonNull public <E extends Throwable> Map.Entry<Object,Method> resolveMethodWithInstance(Class<E> exceptionType)
E - type of exceptionexceptionType - exception to check