FIX: attempt to output a useful error message

FIX: attempt to output a useful error message

currently AWS problems will just dump a stack trace

diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 85cd804..817f00c 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

GitHub sha: aee3c2c3

This commit appears in #10366 which was approved by ZogStriP. It was merged by andrewschleifer.