]> cat aescling's git repositories - mastodon.git/commitdiff
Rescue Mastodon::LengthValidationError in Remoteable (#7228)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 22 Apr 2018 13:42:00 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Sun, 22 Apr 2018 13:42:00 +0000 (15:42 +0200)
Fix #7198 by allowing records with optional attachments to save

app/models/concerns/remotable.rb

index 3b8c507c31fb6af76a813e685f3462eaa4bbd6e2..7f1ef5191bb0737428f47508c1ce70e0c7f4d0a2 100644 (file)
@@ -38,7 +38,7 @@ module Remotable
 
             self[attribute_name] = url if has_attribute?(attribute_name)
           end
-        rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError => e
+        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
         end