From 215ffc792ef4be599e9434ee64f958744d2508f1 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 4 Apr 2019 21:14:18 +0100 Subject: [PATCH] HADOOP-16197 S3AUtils.translateException to map CredentialInitializationException to AccessDeniedException Contributed by Steve Loughran. Change-Id: Ie98ca5210bf0009f297edbcacf1fc6dfe5ea70cd. --- .../src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java index f3235545c49..8d204d7c560 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java @@ -48,7 +48,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.fs.s3a.auth.IAMInstanceCredentialsProvider; -import org.apache.hadoop.fs.s3a.auth.NoAuthWithAWSException; import org.apache.hadoop.fs.s3native.S3xLoginHelper; import org.apache.hadoop.net.ConnectTimeoutException; import org.apache.hadoop.security.ProviderUtils; @@ -193,7 +192,7 @@ public final class S3AUtils { // call considered an sign of connectivity failure return (EOFException)new EOFException(message).initCause(exception); } - if (exception instanceof NoAuthWithAWSException) { + if (exception instanceof CredentialInitializationException) { // the exception raised by AWSCredentialProvider list if the // credentials were not accepted. return (AccessDeniedException)new AccessDeniedException(path, null,