mirror of
https://github.com/lostisland/faraday.git
synced 2025-11-29 00:03:35 -05:00
Add DEFAULT_EXCEPTIONS constant to Request::Retry (#814)
This commit is contained in:
parent
f08a985bd1
commit
f26a8d675b
@ -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 @@ module Faraday
|
||||
end
|
||||
|
||||
def exceptions
|
||||
Array(self[:exceptions] ||= [Errno::ETIMEDOUT, 'Timeout::Error',
|
||||
Error::TimeoutError,
|
||||
Faraday::Error::RetriableResponse])
|
||||
Array(self[:exceptions] ||= DEFAULT_EXCEPTIONS)
|
||||
end
|
||||
|
||||
def methods
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user