Skip to content

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

FIX: don't raise an error if file not found in S3. (#17841)

Vinoth Kannan169f2ad44312
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 111c8b5ce19..859ca462cac 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -97,12 +97,12 @@ class S3Helper
# delete the file
s3_filename.prepend(multisite_upload_path) if Rails.configuration.multisite
delete_object(get_path_for_s3_upload(s3_filename))
- rescue Aws::S3::Errors::NoSuchKey
+ rescue Aws::S3::Errors::NoSuchKey, Aws::S3::Errors::NotFound
end
def delete_object(key)
s3_bucket.object(key).delete
- rescue Aws::S3::Errors::NoSuchKey
+ rescue Aws::S3::Errors::NoSuchKey, Aws::S3::Errors::NotFound
end
def copy(source, destination, options: {})