From 6d9ad30bf861b2422c5951f7593a657675fedc24 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 5 May 2021 23:46:59 +0200 Subject: Fix media redownload worker retrying on unexpected response codes (#16111) --- lib/exceptions.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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 -- cgit