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

 ##########
 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:
   done

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to