Package org.apache.dubbo.remoting.http12
Interface ExceptionHandler<E extends Throwable,T>
- Type Parameters:
E- the type of exception to handleT- the type of result returned
Interface for customize exception handling.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Thandle(E throwable, RequestMetadata metadata, MethodDescriptor descriptor) Handle the exception and return a result.default ThandleGrpc(E throwable, RequestMetadata metadata, MethodDescriptor descriptor) Handles the exception and return a result for gRPC protocol.default booleanresolveGrpcStatus(E throwable, HttpHeaders headers, RequestMetadata metadata, MethodDescriptor descriptor) Resolves the gRPC status for a given throwable.default LevelresolveLogLevel(E throwable) Resolves the log level for a given throwable.
-
Method Details
-
resolveLogLevel
Resolves the log level for a given throwable.- Parameters:
throwable- the exception- Returns:
- the log level, or null to ignore this extension
-
resolveGrpcStatus
default boolean resolveGrpcStatus(E throwable, HttpHeaders headers, RequestMetadata metadata, MethodDescriptor descriptor) Resolves the gRPC status for a given throwable.- Parameters:
throwable- the exceptionheaders- the response headersmetadata- the request metadata, may be nulldescriptor- the method descriptor, may be null
-
handle
Handle the exception and return a result.- Parameters:
throwable- the exceptionmetadata- the request metadata, may be nulldescriptor- the method descriptor, may be null- Returns:
- a result of type T, or null to ignore this extension
-
handleGrpc
Handles the exception and return a result for gRPC protocol.- Parameters:
throwable- the exceptionmetadata- the request metadata, may be nulldescriptor- the method descriptor, may be null- Returns:
- a result of type T, or null to ignore this extension
-