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

[GitHub] [dubbo] EarthChen commented on a diff in pull request #11859: feat: add exception code

EarthChen commented on code in PR #11859:
URL: https://github.com/apache/dubbo/pull/11859#discussion_r1155074242


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/UnaryClientCallListener.java:
##########
@@ -42,7 +43,8 @@ public void onClose(TriRpcStatus status, Map<String, Object> trailers) {
         AppResponse result = new AppResponse();
         result.setObjectAttachments(trailers);
         if (status.isOk()) {
-            if (appResponse instanceof Exception) {
+           Integer exceptionCode = extractExceptionCode(trailers);
+            if (exceptionCode != 0) {

Review Comment:
   0 should be a constant



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/UnaryServerCallListener.java:
##########
@@ -55,12 +59,28 @@ public void onCancel(TriRpcStatus status) {
     @Override
     protected void doOnResponseHasException(Throwable t) {
         if (needWrapper) {
-            onReturn(t);
+            if (t instanceof Exception) {

Review Comment:
   Is judgment necessary here?



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