Skip to content

Commit 4a64828

Browse files
author
Daman Arora
committed
capture S3 execptions to show actual error messages
1 parent 9a2ba84 commit 4a64828

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

core/src/main/java/com/cloud/storage/template/S3TemplateDownloader.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,15 @@ public void progressChanged(ProgressEvent progressEvent) {
216216
// Wait for the upload to complete.
217217
upload.waitForCompletion();
218218
} catch (InterruptedException e) {
219-
// Interruption while waiting for the upload to complete.
220-
logger.warn("Interruption occurred while waiting for upload of " + downloadUrl + " to complete");
219+
errorString = "Interruption occurred while waiting for upload of " + downloadUrl + " to complete";
220+
logger.warn(errorString);
221+
222+
status = Status.UNRECOVERABLE_ERROR;
223+
} catch (Exception e) {
224+
errorString = "S3 upload failed for " + downloadUrl + ": " + e.getMessage();
225+
logger.warn(errorString, e);
226+
227+
status = Status.UNRECOVERABLE_ERROR;
221228
}
222229

223230
downloadTime = new Date().getTime() - start.getTime();

0 commit comments

Comments
 (0)