With grpc 0.15.0 some time ago I implemented client side exception handler via spring aspect. It converts StatusRuntimeException from the upstream service into my own domain exception and re-throws it. I find it quite convenient as throughout the code I can catch particular exceptions I'm interested in instead of always catching StatusRuntimeException.
I consider switching to the latest (1.6.1) version, and the problem is that client stubs have been made final and it is no longer possible to use aspects. The only (and ugly) solution is to do exception conversion in *cancel* method of SimpleForwardingClientCall(called from catch block in blockingUnaryCall). But in my understanding cancel method is not supposed to throw exceptions, especially in case when cancel is called by the client code itself. For server-streaming calls it is not possible to catch-and-rethrow the exception thrown from iterator at all. With 0.15.0 I wrap returned iterator and override hasNext method to catch and re-throw the exception. Has anyone tried to solve the same problem? Maybe there are plans to include support for such cases in grpc? Thank you in advance. -- CONFIDENTIALITY NOTICE: This email and files attached to it are confidential. If you are not the intended recipient you are hereby notified that using, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error please notify the sender and delete this email. -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/013c64e2-becd-4a8a-976a-727b9e0478f4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
