Skip to content

A platform for community discussion. Free, open, simple.

FIX: attempt to output a useful error message

Andrew Schleiferaee3c2c34d55
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 85cd8043d3a..817f00c0326 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -228,9 +228,9 @@ class S3Helper
end
def download_file(filename, destination_path, failure_message = nil)
- unless object(filename).download_file(destination_path)
- raise failure_message&.to_s || "Failed to download file"
- end
+ object(filename).download_file(destination_path)
+ rescue => err
+ raise failure_message&.to_s || "Failed to download #{filename} because #{err.message}"
end
def s3_client