Handle Mastodon::HostValidationError when pulling remoteable assets (#6782)

This will prevent, for example, `rake mastodon:redownload_avatars` from crashing when an instance is no longer responding to connection attempts, instead silently continuing as expected.
lolsob-rspec
Daniel Hunsaker 2018-03-17 06:27:50 -06:00 committed by Eugen Rochko
parent 7b247b15f2
commit 8f374100ed
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ module Remotable
send("#{attachment_name}_file_name=", basename + extname)
self[attribute_name] = url if has_attribute?(attribute_name)
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError => e
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError => e
Rails.logger.debug "Error fetching remote #{attachment_name}: #{e}"
nil
end