You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/10/18 09:44:32 UTC

[GitHub] [hadoop-ozone] supratimdeka commented on a change in pull request #47: HDDS-2208. Propagate System Exceptions from OM transaction apply phase. Contributed by Supratim Deka

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org