Exception: Ffccmmx::HTTPXRetryableError
Instance Attribute Summary
Attributes inherited from HTTPXError
#response
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from HTTPXError
#initialize
Class Method Details
.retryable_error?(error) ⇒ Boolean
18
19
20
21
22
23
|
# File 'lib/ffccmmx/exceptions.rb', line 18
def self.retryable_error?(error)
return false unless error.respond_to?(:response)
return false if error.response.nil?
RETRYABLE_STATUS_CODES.include?(error.response.status)
end
|
Instance Method Details
#retry_time(count: 1) ⇒ Object
25
26
27
28
|
# File 'lib/ffccmmx/exceptions.rb', line 25
def retry_time(count: 1)
retry_seconds = response.["retry-after"] ? response.["retry-after"].to_i : 2**count
Time.now + retry_seconds
end
|