bharatviswa504 commented on a change in pull request #47: HDDS-2208. Propagate System Exceptions from OM transaction apply phase. Contributed by Supratim Deka URL: https://github.com/apache/hadoop-ozone/pull/47#discussion_r336256847
########## File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java ########## @@ -180,13 +181,22 @@ protected OMResponse createErrorOMResponse( @Nonnull OMResponse.Builder omResponse, @Nonnull IOException ex) { omResponse.setSuccess(false); - if (ex.getMessage() != null) { - omResponse.setMessage(ex.getMessage()); + String errorMsg = exceptionErrorMessage(ex); + if (errorMsg != null) { + omResponse.setMessage(errorMsg); } omResponse.setStatus(OzoneManagerRatisUtils.exceptionToResponseStatus(ex)); return omResponse.build(); } + private String exceptionErrorMessage(IOException ex) { + if (ex instanceof OMException) { + return ex.getMessage(); + } else { + return org.apache.hadoop.util.StringUtils.stringifyException(ex); Review comment: Minor NIT: checkstyle extra space. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org