rich7420 commented on code in PR #11189:
URL: https://github.com/apache/ozone/pull/11189#discussion_r3950057973


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketLifecycleHandler.java:
##########
@@ -142,17 +142,17 @@ public Response 
putBucketLifecycleConfiguration(S3RequestContext context, String
       // translation maps to InvalidRequest. AWS S3 uses InvalidArgument for a 
rejected lifecycle
       // configuration, so only this validation step is remapped.
       if (ex.getResult() == OMException.ResultCodes.INVALID_REQUEST) {
-        throw S3ErrorTable.newError(S3ErrorTable.INVALID_ARGUMENT, bucketName, 
ex);
+        throw S3ErrorTable.newError(S3ErrorTable.INVALID_ARGUMENT, bucketName, 
ex).withMessage(ex.getMessage());
       }
-      throw S3ErrorTable.newError(bucketName, ex);
+      throw S3ErrorTable.newError(bucketName, ex).withMessage(ex.getMessage());
     }
 
     try {
       ozoneBucket.setLifecycleConfiguration(lcc);
     } catch (OMException ex) {
       // OM raises INVALID_REQUEST for server-side conditions as well, such as 
a bucket layout
       // mismatch, so its result codes keep the shared translation instead of 
being remapped.
-      throw S3ErrorTable.newError(bucketName, ex);
+      throw S3ErrorTable.newError(bucketName, ex).withMessage(ex.getMessage());

Review Comment:
   This exposes raw OM messages for non-validation failures: 
`S3ErrorTable.translateResultCode()` maps `INTERNAL_ERROR` to the standard 
generic message, but this override replaces it with `ex.getMessage()`. Please 
apply the override only to `INVALID_REQUEST` and keep the standard message 
otherwise.



-- 
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]

Reply via email to