class Translatomatic::HTTP::Client::HttpRetryExecutor

Retry requests on server errors

Public Instance Methods

http_exception?(exception) click to toggle source
# File lib/translatomatic/http/client.rb, line 77
def http_exception?(exception)
  exception.is_a?(Translatomatic::HTTP::Exception)
end
retriable?(exception) click to toggle source
# File lib/translatomatic/http/client.rb, line 73
def retriable?(exception)
  http_exception?(exception) && retriable_exception?(exception)
end
retriable_exception?(exception) click to toggle source
# 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