-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: remove TripleRpcException #8712
feature: remove TripleRpcException #8712
Conversation
Plz fix code format |
done. pls feel free to review, thx |
Codecov Report
@@ Coverage Diff @@
## 3.0 #8712 +/- ##
============================================
+ Coverage 63.69% 63.73% +0.04%
- Complexity 313 314 +1
============================================
Files 1146 1145 -1
Lines 48145 48160 +15
Branches 7252 7250 -2
============================================
+ Hits 30668 30697 +29
+ Misses 14111 14103 -8
+ Partials 3366 3360 -6
Continue to review full report at Codecov.
|
code = Code.ABORTED; | ||
break; | ||
case TIMEOUT_TERMINATE: | ||
code = Code.OUT_OF_RANGE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEADLINE_EXCEEDED
code = Code.PERMISSION_DENIED; | ||
break; | ||
case LIMIT_EXCEEDED_EXCEPTION: | ||
code = Code.ABORTED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
UNAVAILABLE will be better
} | ||
return fromCode(code); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NETWORK_EXCEPTION
-> UNAVAILABLE
SERIALIZATION_EXCEPTION
-> INTERNAL
if (exception instanceof TripleRpcException) { | ||
transportError(((TripleRpcException) exception).getStatus(), response.getObjectAttachments()); | ||
if (exception instanceof RpcException) { | ||
transportError(rpcExceptionCodeToGrpc(((RpcException) exception).getCode()), response.getObjectAttachments()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detail msg in RPCException
has been dropped, should be pass to Status
' description
if (e instanceof TripleRpcException) { | ||
transportError(((TripleRpcException) e).getStatus(), response.getObjectAttachments()); | ||
if (e instanceof RpcException) { | ||
transportError(rpcExceptionCodeToGrpc(((RpcException) e).getCode()), response.getObjectAttachments()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above
@@ -82,6 +83,28 @@ public static byte toDubboStatus(Code code) { | |||
return status; | |||
} | |||
|
|||
public static GrpcStatus rpcExceptionCodeToGrpc(int rpcExceptionCode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to replace it with enum?and put them in map and getValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of the change
Remove and support dubbo status to triple status mapping for issue #8659
Brief changelog
Verifying this change
Checklist