Hi Friends,
We have gRPC server which receives the request, and based upon one specific validation, we want to return the request without sending it to service.
We implemented the below class..
public class MyInterceptor implements ServerInterceptor {
@Override
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {
if(!someCondition) {
call.close(Status.UNKNOWN, headers);
return new ServerCall.Listener<ReqT>() {};
}
return next.startCall(call, headers);
}
}
the problem with this code is that, at client end it gives the below error trace..
Exception in thread "main" io.grpc.StatusRuntimeException: UNKNOWN
can we send the proper response with error code so that client will get specific error code and not the above error message
Thanks in advance for your help and advice.
Regards
Anurag