From 1fcdaafa6fbe6d746a096c33263d76e6819da46d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 20 Jul 2017 01:59:07 +0200 Subject: Fix webfinger retries (#4275) * Do not raise unretryable exceptions in ResolveRemoteAccountService * Removed fatal exceptions from ResolveRemoteAccountService Exceptions that cannot be retried should not be raised. New exception class for those that can be retried (Mastodon::UnexpectedResponseError) --- app/lib/exceptions.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/lib') diff --git a/app/lib/exceptions.rb b/app/lib/exceptions.rb index 9bc802c12..34d84a34f 100644 --- a/app/lib/exceptions.rb +++ b/app/lib/exceptions.rb @@ -5,4 +5,14 @@ module Mastodon class NotPermittedError < Error; end class ValidationError < Error; end class RaceConditionError < Error; end + + class UnexpectedResponseError < Error + def initialize(response = nil) + @response = response + end + + def to_s + "#{@response.uri} returned code #{@response.code}" + end + end end -- cgit