FIX: attempt to output a useful error message

currently AWS problems will just dump a stack trace
This commit is contained in:
Andrew Schleifer 2020-08-04 11:08:37 +08:00
parent f4502d7739
commit aee3c2c34d

View File

@ -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