How many stubs / channels do you have? Why not just do the conversion in an interceptor?
On Friday, September 29, 2017 at 6:19:27 AM UTC-7, [email protected] wrote: > > 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. > -- 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/a12a5286-a4d1-4aee-a7b5-2457f8031c13%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
