Skip to content

Commit 327a83e

Browse files
committed
Tweak
1 parent bb1c279 commit 327a83e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bolt/src/main/java/com/slack/api/bolt/service/builtin/AmazonS3InstallationService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ public Initializer initializer() {
4646
log.debug("AWS credentials loaded (access key id: {})", credentials.accessKeyId());
4747
}
4848
boolean bucketExists = false;
49-
Exception error = null;
49+
Exception ex = null;
5050
try (S3Client s3 = createS3Client()) {
5151
bucketExists = s3.headBucket(HeadBucketRequest.builder().bucket(bucketName).build()) != null;
5252
} catch (Exception e) { // NoSuchBucketException etc.
53-
error = e;
53+
ex = e;
5454
}
5555
if (!bucketExists) {
56+
String error = ex != null ? ex.getClass().getName() + ":" + ex.getMessage() : "-";
5657
String message = "Failed to access the Amazon S3 bucket (name: " + bucketName + ", error: " + error + ")";
5758
throw new IllegalStateException(message);
5859
}

bolt/src/main/java/com/slack/api/bolt/service/builtin/AmazonS3OAuthStateService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ public Initializer initializer() {
4242
log.debug("AWS credentials loaded (access key id: {})", credentials.accessKeyId());
4343
}
4444
boolean bucketExists = false;
45-
Exception error = null;
45+
Exception ex = null;
4646
try (S3Client s3 = createS3Client()) {
4747
bucketExists = s3.headBucket(HeadBucketRequest.builder().bucket(bucketName).build()) != null;
4848
} catch (Exception e) { // NoSuchBucketException etc.
49-
error = e;
49+
ex = e;
5050
}
5151
if (!bucketExists) {
52+
String error = ex != null ? ex.getClass().getName() + ":" + ex.getMessage() : "-";
5253
String message = "Failed to access the Amazon S3 bucket (name: " + bucketName + ", error: " + error + ")";
5354
throw new IllegalStateException(message);
5455
}

0 commit comments

Comments
 (0)