peterxcli commented on code in PR #11763:
URL: https://github.com/apache/ozone/pull/11763#discussion_r4476161984
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerServiceGrpc.java:
##########
@@ -108,10 +109,8 @@ public void submitRequest(OMRequest request,
responseObserver.onNext(omResponse);
} catch (Throwable e) {
LOG.error("Failed to submit request", e);
- IOException ex = new IOException(e.getCause());
- responseObserver.onError(
- Status.INTERNAL.withDescription(ex.getMessage())
- .asRuntimeException());
+ Throwable omException = e instanceof ServiceException ? e.getCause() : e;
Review Comment:
turned to use existing helper for null handling:
https://github.com/apache/ozone/blob/cea2af2c0ab425a3dbb5f87c436003400a8223ea/hadoop-hdds/common/src/main/java/org/apache/hadoop/ipc_/ProtobufHelper.java#L33-L46
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerServiceGrpc.java:
##########
@@ -108,10 +109,8 @@ public void submitRequest(OMRequest request,
responseObserver.onNext(omResponse);
} catch (Throwable e) {
LOG.error("Failed to submit request", e);
- IOException ex = new IOException(e.getCause());
- responseObserver.onError(
- Status.INTERNAL.withDescription(ex.getMessage())
- .asRuntimeException());
+ Throwable omException = e instanceof ServiceException ? e.getCause() : e;
Review Comment:
turned to use existing helper for null handling:
https://github.com/apache/ozone/blob/cea2af2c0ab425a3dbb5f87c436003400a8223ea/hadoop-hdds/common/src/main/java/org/apache/hadoop/ipc_/ProtobufHelper.java#L33-L46
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]