-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java implementation #4
Comments
Hi @BulatMukhutdinov, it might take some time with Java examples as I am not really a Java dev. However I will keep this issue open and hope someone contributes |
Maybe you could get inspired / get a PR from the author |
@avinassh Hi,Can you please also provide an example in PHP? |
Thanks @simplesteph for the pointer. It looks like https://github.com/saturnism/grpc-by-example-java/blob/master/error-handling-example/error-server/src/main/java/com/example/grpc/server/ErrorServiceImpl.java#L33 is they key example: @Override
public void customException(EchoRequest request, StreamObserver<EchoResponse> responseObserver) {
try {
throw new CustomException("Custom exception!");
} catch (Exception e) {
responseObserver.onError(Status.INTERNAL
.withDescription(e.getMessage())
.augmentDescription("customException()")
.withCause(e) // This can be attached to the Status locally, but NOT transmitted to the client!
.asRuntimeException());
}
} |
Hi
Thank you for your nice lib!
Can you please also provide an example in Java?
The text was updated successfully, but these errors were encountered: