Package io.grpc.util
Class TransmitStatusRuntimeExceptionInterceptor
- java.lang.Object
-
- io.grpc.util.TransmitStatusRuntimeExceptionInterceptor
-
- All Implemented Interfaces:
io.grpc.ServerInterceptor
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2189") public final class TransmitStatusRuntimeExceptionInterceptor extends java.lang.Object implements io.grpc.ServerInterceptorA class that intercepts uncaught exceptions of typeStatusRuntimeExceptionand handles them by closing theServerCall, and transmitting the exception's status and metadata to the client.Without this interceptor, gRPC will strip all details and close the
ServerCallwith a genericStatus.UNKNOWNcode.Security warning: the
StatusandMetadatamay contain sensitive server-side state information, and generally should not be sent to clients. Only install this interceptor if all clients are trusted.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static io.grpc.ServerInterceptorinstance()<ReqT,RespT>
io.grpc.ServerCall.Listener<ReqT>interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
-
-
-
Method Detail
-
instance
public static io.grpc.ServerInterceptor instance()
-
interceptCall
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)- Specified by:
interceptCallin interfaceio.grpc.ServerInterceptor
-
-