diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2021-05-05 23:46:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 23:46:59 +0200 |
commit | 6d9ad30bf861b2422c5951f7593a657675fedc24 (patch) | |
tree | 9c11fe1743a591cb7914211b6524eee74676dd68 /lib | |
parent | aa1b43f46786ad23098159f1210b1811c64de72a (diff) |
Fix media redownload worker retrying on unexpected response codes (#16111)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exceptions.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/exceptions.rb b/lib/exceptions.rb index 7c8e77871..eb472abaa 100644 --- a/lib/exceptions.rb +++ b/lib/exceptions.rb @@ -12,7 +12,11 @@ module Mastodon class RateLimitExceededError < Error; end class UnexpectedResponseError < Error + attr_reader :response + def initialize(response = nil) + @response = response + if response.respond_to? :uri super("#{response.uri} returned code #{response.code}") else |