Skip to content

Commit 3cd97cc

Browse files
Add extra S3 logging
1 parent 4c93129 commit 3cd97cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/com/uid2/shared/cloud/CloudStorageS3.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,16 @@ public InputStream download(String cloudPath) throws CloudStorageException {
131131
S3Object obj = this.s3.getObject(bucket, cloudPath);
132132
return obj.getObjectContent();
133133
} catch (AmazonS3Exception e) {
134+
<<<<<<< Updated upstream
134135
if (e.getErrorCode().equals("NoSuchKey")) {
135136
throw new CloudStorageException("The specified key does not exist: " + e.getClass().getSimpleName() + ": " + bucket);
136137
} else {
137138
throw new CloudStorageException("s3 get error: " + e.getClass().getSimpleName() + ": " + bucket);
138139
}
140+
=======
141+
LOGGER.error("AWS S3 error: " + e.getMessage() + " for path: " + cloudPath + " in bucket: " + bucket + " with status code: " + e.getStatusCode() + " and error code: " + e.getErrorCode());
142+
throw new CloudStorageException("s3 get error: " + e.getMessage(), e);
143+
>>>>>>> Stashed changes
139144
} catch (Throwable t) {
140145
// Do not log the message or the original exception as that may contain the pre-signed url
141146
throw new CloudStorageException("s3 get error: " + t.getClass().getSimpleName() + ": " + bucket);

0 commit comments

Comments
 (0)