From be7eeb785682d80614340c63f6cf3d36e5e4fe2e Mon Sep 17 00:00:00 2001
From: ThibG <thib@sitedethib.com>
Date: Fri, 11 May 2018 13:14:50 +0200
Subject: [PATCH] Catch Paperclip processing failures (fixes #6378) (#7439)

---
 app/models/concerns/remotable.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/models/concerns/remotable.rb b/app/models/concerns/remotable.rb
index 7f1ef5191b..20ddbca53c 100644
--- a/app/models/concerns/remotable.rb
+++ b/app/models/concerns/remotable.rb
@@ -41,6 +41,9 @@ module Remotable
         rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
           Rails.logger.debug "Error fetching remote #{attachment_name}: #{e}"
           nil
+        rescue Paperclip::Error => e
+          Rails.logger.debug "Error processing remote #{attachment_name}: #{e}"
+          nil
         end
       end
 
-- 
GitLab