Class: Translatomatic::HTTP::Client::HttpRetryExecutor
Overview
Retry requests on server errors
Instance Method Summary
collapse
#initialize, #run
Instance Method Details
#http_exception?(exception) ⇒ Boolean
77
78
79
|
# File 'lib/translatomatic/http/client.rb', line 77
def http_exception?(exception)
exception.is_a?(Translatomatic::HTTP::Exception)
end
|
#retriable?(exception) ⇒ Boolean
73
74
75
|
# File 'lib/translatomatic/http/client.rb', line 73
def retriable?(exception)
http_exception?(exception) && retriable_exception?(exception)
end
|
#retriable_exception?(exception) ⇒ Boolean
81
82
83
84
|
# File 'lib/translatomatic/http/client.rb', line 81
def retriable_exception?(exception)
RETRIABLE.any? { |i| exception.response.kind_of?(i) } ||
RETRIABLE_CODES.include?(exception.response.code.to_i)
end
|