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