How to add global exception interceptor in gRPC server?

Below code will catch all runtime exceptions, Also refer the link https://github.com/grpc/grpc-java/issues/1552 public class GlobalGrpcExceptionHandler implements ServerInterceptor { @Override public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call, Metadata requestHeaders, ServerCallHandler<ReqT, RespT> next) { ServerCall.Listener<ReqT> delegate = next.startCall(call, requestHeaders); return new SimpleForwardingServerCallListener<ReqT>(delegate) { @Override public void onHalfClose() { try { super.onHalfClose(); } catch (Exception e) { call.close(Status.INTERNAL … Read more

File not found.