You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/07/14 10:26:09 UTC

[GitHub] [hadoop] steveloughran commented on a change in pull request #3202: HADOOP-17801. No error message reported when bucket doesn't exist in S3AFS

steveloughran commented on a change in pull request #3202:
URL: https://github.com/apache/hadoop/pull/3202#discussion_r669486623



##########
File path: hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java
##########
@@ -254,7 +254,7 @@ public static IOException translateException(@Nullable String operation,
       case 404:
         if (isUnknownBucket(ase)) {
           // this is a missing bucket
-          ioe = new UnknownStoreException(path, ase);
+          ioe = new UnknownStoreException(message, ase);

Review comment:
       Should we make UnknownStoreException a subclass of PathIOE and supply the path in the constructor there

##########
File path: hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestS3AExceptionTranslation.java
##########
@@ -181,8 +182,12 @@ private static AmazonS3Exception createS3Exception(String message, int code,
 
   private static <E extends Throwable> E verifyTranslated(Class<E> clazz,
       AmazonClientException exception) throws Exception {
-    return verifyExceptionClass(clazz,
-        translateException("test", "/", exception));
+    // Verifying that the translated exception have the correct error message.
+    IOException ioe = translateException("test", "/", exception);
+    Assertions.assertThat(ioe.getMessage()).describedAs("Translated "

Review comment:
       if there is a mismatch, can you rethrow the entire exception. See (or use GenericTestUtils.assertExceptionContains()) 
   
   ```java
   throw new AssertionError(<that message>, ioe);




-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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