Skip to content

Commit 570f973

Browse files
committed
Fix conditional blocks
1 parent 088e4d7 commit 570f973

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/handlers/ExceptionTranslationInterceptor.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ public Throwable modifyException(Context.FailedExecution context, ExecutionAttri
7575
.message(message)
7676
.build();
7777
}
78-
}
79-
80-
if (exception.statusCode() == 503) {
78+
} else if (exception.statusCode() == 503) {
8179
if ("Slow Down".equals(errorDetails.sdkHttpResponse().statusText().orElse(null))) {
8280
return S3Exception.builder()
8381
.awsErrorDetails(fillErrorDetails(errorDetails, "SlowDown",
@@ -88,9 +86,7 @@ public Throwable modifyException(Context.FailedExecution context, ExecutionAttri
8886
.message(message)
8987
.build();
9088
}
91-
}
92-
93-
if (errorDetails.errorMessage() == null) {
89+
} else if (errorDetails.errorMessage() == null) {
9490
// Populate the error message using the HTTP response status text. Usually that's just the value from the
9591
// HTTP spec (e.g. "Forbidden"), but sometimes S3 throws some more useful things in there, like "Slow Down".
9692
String errorMessage = errorDetails.sdkHttpResponse().statusText().orElse(null);

0 commit comments

Comments
 (0)