Rescue Mastodon::LengthValidationError in Remoteable (#7228)

Fix #7198 by allowing records with optional attachments to save
master
Eugen Rochko 7 years ago committed by GitHub
parent b305a23933
commit 4ca2f73b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/concerns/remotable.rb

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

Loading…
Cancel
Save