1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

ET-2352 Throw RequestLimitExceeded error if out of retries.

This commit is contained in:
Michael Sawyer 2017-04-20 15:36:39 -07:00
parent 31136f1654
commit 8ffa533090

View file

@ -3,6 +3,8 @@ module Fog
class AWS < Fog::Service
extend Fog::AWS::CredentialFetcher::ServiceMethods
class RequestLimitExceeded < Fog::Errors::Error; end
requires :aws_access_key_id, :aws_secret_access_key
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :version
@ -560,7 +562,7 @@ module Fog
sleep (2.0 ** (1.0 + retries) * 100) / 1000.0
_request(body, headers, idempotent, parser, retries + 1)
else
Fog::Compute::AWS::Error.slurp(error, "Max retries exceeded (#{max_retries}) #{match[:code]} => #{match[:message]}")
Fog::Compute::AWS::RequestLimitExceeded.slurp(error, "Max retries exceeded (#{max_retries}) #{match[:code]} => #{match[:message]}")
end
else
Fog::Compute::AWS::Error.slurp(error, "#{match[:code]} => #{match[:message]}")