diff options
author | Daniel Hunsaker <danhunsaker@gmail.com> | 2018-03-17 06:27:50 -0600 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-17 13:27:50 +0100 |
commit | 4a0a19fe54f1d2d433ad3d72c35f2bbb915279f6 (patch) | |
tree | 44176a28a098a137a5d15cd31d57cf59b01a400d /app | |
parent | 338bff8b93fa939c2968818e53386fd0c013d9a9 (diff) |
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.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/remotable.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/remotable.rb b/app/models/concerns/remotable.rb index 020303a2f..69685ec83 100644 --- a/app/models/concerns/remotable.rb +++ b/app/models/concerns/remotable.rb @@ -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 |