You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "takeseem (GitHub)" <gi...@apache.org> on 2020/03/16 00:39:44 UTC

[GitHub] [dubbo] takeseem commented on issue #5821: consumer端自定义异常没有正确反序列化

@mbc3320 如果用x-common来公开异常,异常在跨RPC链传递时,上上游的consumer不一定会依赖x-common导致反序列化失败。

ApiException(是RuntimeException)作为一个唯一的业务异常,放在框架中,承担的作用

1. 任何项目都有此异常,且跨 RPC 时非 JDK 内置异常都会包装转换为此异常(注意case、supperessed也要转换),保证 RPC 链中能正常处理异常
2. 以前用 instanceof 判定特异常,ApiException 是通过code,非要判断原始异常时用:ex字段('原始异常的类全名')来判断

[ Full content available at: https://github.com/apache/dubbo/issues/5821 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org