zhoutianli518 commented on issue #2051:
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/2051#issuecomment-731948550


   
   @wujimin 场景是这样的:
   
我们微服务框架从dubbo切到cse。我们使用dubbo好多年了。当前服务提供方通过自定义的异常将错误码和错误描述带给客户端。采用抛异常方式中断异常流程,保持主流程代码整洁。使用CSE后,在服务端,我们实现ExceptionToProducerResponseConverter扩展点,将服务端的异常信息通过error
 
data带回给客户端。在客户端,因为没有扩展机制,拿到的都是InvocationException。如果客户端也能提供一个异常处理的SPI机制,我们实现这个SPI接口后,将InvocationException里的error
 data解析一下,换成业务自定义的异常抛出去,那么基本上能实现dubbo到cse的平滑切换,上层业务无感知。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to