ソースを参照

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.
master
Daniel Hunsaker 6年前
committed by Eugen Rochko
コミット
4a0a19fe54
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      app/models/concerns/remotable.rb

+ 1
- 1
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


読み込み中…
キャンセル
保存