public class GrpcExceptionInterceptor extends Object implements io.grpc.ServerInterceptor
Throwable
is caught and being processed.
Actual processing of exception is in GrpcExceptionListener
.
GrpcAdviceExceptionHandler
,
GrpcExceptionListener
Constructor and Description |
---|
GrpcExceptionInterceptor(GrpcExceptionResponseHandler grpcAdviceExceptionHandler)
Creates a new GrpcAdviceExceptionInterceptor.
|
Modifier and Type | Method and Description |
---|---|
<ReqT,RespT> |
interceptCall(io.grpc.ServerCall<ReqT,RespT> call,
io.grpc.Metadata headers,
io.grpc.ServerCallHandler<ReqT,RespT> next) |
protected <ReqT> io.grpc.ServerCall.Listener<ReqT> |
noOpCallListener()
Creates a new no-op call listener because you can neither return null nor throw an exception in
interceptCall(ServerCall, Metadata, ServerCallHandler) . |
public GrpcExceptionInterceptor(GrpcExceptionResponseHandler grpcAdviceExceptionHandler)
grpcAdviceExceptionHandler
- The exception handler to use.public <ReqT,RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
interceptCall
in interface io.grpc.ServerInterceptor
protected <ReqT> io.grpc.ServerCall.Listener<ReqT> noOpCallListener()
interceptCall(ServerCall, Metadata, ServerCallHandler)
.ReqT
- The type of the request.