Skip to content

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

FIX: AWS S3 errors don't necessarily include a message

Michael Brownc25dc43f5409
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 817f00c0326..636b27800cb 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -230,7 +230,7 @@ class S3Helper
def download_file(filename, destination_path, failure_message = nil)
object(filename).download_file(destination_path)
rescue => err
- raise failure_message&.to_s || "Failed to download #{filename} because #{err.message}"
+ raise failure_message&.to_s || "Failed to download #{filename} because #{err.message.length > 0 ? err.message : err.class.to_s}"
end
def s3_client