Skip to content

Commit

Permalink
Fill exception msg
Browse files Browse the repository at this point in the history
  • Loading branch information
guohao committed Sep 8, 2021
1 parent b82c966 commit 22f194a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public void invoke() {
if (response.hasException()) {
final Throwable exception = response.getException();
if (exception instanceof RpcException) {
transportError(rpcExceptionCodeToGrpc(((RpcException) exception).getCode()), response.getObjectAttachments());
final GrpcStatus status = rpcExceptionCodeToGrpc(((RpcException) exception).getCode())
.withCause(exception);
transportError(status, response.getObjectAttachments());
} else {
transportError(GrpcStatus.fromCode(GrpcStatus.Code.UNKNOWN)
.withCause(exception), response.getObjectAttachments());
Expand Down Expand Up @@ -134,7 +136,9 @@ public void invoke() {
} catch (Throwable e) {
LOGGER.warn("Exception processing triple message", e);
if (e instanceof RpcException) {
transportError(rpcExceptionCodeToGrpc(((RpcException) e).getCode()), response.getObjectAttachments());
final GrpcStatus status = rpcExceptionCodeToGrpc(((RpcException) e).getCode())
.withCause(e);
transportError(status, response.getObjectAttachments());
} else {
transportError(GrpcStatus.fromCode(GrpcStatus.Code.UNKNOWN)
.withDescription("Exception occurred in provider's execution:" + e.getMessage())
Expand Down

0 comments on commit 22f194a

Please sign in to comment.