diff --git a/lib/faraday/request/retry.rb b/lib/faraday/request/retry.rb index 0d132f188..5324f6e71 100644 --- a/lib/faraday/request/retry.rb +++ b/lib/faraday/request/retry.rb @@ -20,6 +20,7 @@ module Faraday # class Request::Retry < Faraday::Middleware + DEFAULT_EXCEPTIONS = [Errno::ETIMEDOUT, 'Timeout::Error', Error::TimeoutError, Faraday::Error::RetriableResponse].freeze IDEMPOTENT_METHODS = [:delete, :get, :head, :options, :put] class Options < Faraday::Options.new(:max, :interval, :max_interval, :interval_randomness, @@ -57,9 +58,7 @@ def backoff_factor end def exceptions - Array(self[:exceptions] ||= [Errno::ETIMEDOUT, 'Timeout::Error', - Error::TimeoutError, - Faraday::Error::RetriableResponse]) + Array(self[:exceptions] ||= DEFAULT_EXCEPTIONS) end def methods