You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "liufeiyu1002 (via GitHub)" <gi...@apache.org> on 2023/04/13 08:50:59 UTC

[GitHub] [dubbo] liufeiyu1002 commented on issue #12076: dubbo-java 3.2 beta 服务端全局异常处理filter 无法按预期执行

liufeiyu1002 commented on issue #12076:
URL: https://github.com/apache/dubbo/issues/12076#issuecomment-1506590868

   我认为这个应该是符合预期的,
   图1
   ![image](https://user-images.githubusercontent.com/32605119/231703967-ada2911b-ed87-42fe-a9aa-308f67b44bcc.png)
   图2
   ![image](https://user-images.githubusercontent.com/32605119/231704650-f3215540-bd32-457b-ba5f-17182cb9e94b.png)
   图3
   ![image](https://user-images.githubusercontent.com/32605119/231705554-af7f93d1-b2aa-4332-84cd-a8e69b90e34e.png)
   1.  `doInvoke` 里会通过反射调用业务方法,当业务方法抛出异常时 会被后边的 catch 捕获如  3位置所示, 此时 t!=null 
   2. 看图2 `wrapWithFuture` 调用以后会对结果包装 分3 中情况 1. 接口本身返回是CompletedFuture类型的 2. 调用时异步的 3.包装一个completedFuture返回  ---你的情况应该是 3 这种
   3. 图3 中能看到执行 `onError` 还是 `onResponse` 是按照 t 是否为null 来判断的
   4. 在 `OnResponse` 中判断 `appResponse.hasException()` 可以对应到2结果返回是 如果接口本身返回是`CompletedFuture`类型。接口正常返回但是结果是 `error` 的


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org