You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/12/05 15:03:17 UTC

[GitHub] [ozone] xiaoyuyao commented on a change in pull request #1642: HDDS-4519. Return forbidden instead of interval server error from s3g…

xiaoyuyao commented on a change in pull request #1642:
URL: https://github.com/apache/ozone/pull/1642#discussion_r536804873



##########
File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -619,6 +631,9 @@ private Response createMultipartKey(String bucket, String key, long length,
       if (ex.getResult() == ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR) {
         throw S3ErrorTable.newError(NO_SUCH_UPLOAD,
             uploadID);
+      } else if (ex.getResult() == ResultCodes.PERMISSION_DENIED) {

Review comment:
       Is it possible to have a common helper that does the OM result code => s3 error translation?

##########
File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java
##########
@@ -105,6 +106,9 @@ private S3ErrorTable() {
       "InternalError", "We encountered an internal error. Please try again.",
       HTTP_SERVER_ERROR);
 
+  public static final OS3Exception PERMISSION_DENIED = new OS3Exception(

Review comment:
       +1 for return 403




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org