Class: Aws::Plugins::RetryErrors::ErrorInspector Private
- Inherits:
-
Object
- Object
- Aws::Plugins::RetryErrors::ErrorInspector
- Defined in:
- lib/aws-sdk-core/plugins/retry_errors.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- EXPIRED_CREDS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new([ 'InvalidClientTokenId', # query services 'UnrecognizedClientException', # json services 'InvalidAccessKeyId', # s3 'AuthFailure', # ec2 'InvalidIdentityToken', # sts 'ExpiredToken', # route53 ])
- THROTTLING_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new([ 'Throttling', # query services 'ThrottlingException', # json services 'RequestThrottled', # sqs 'RequestThrottledException', 'ProvisionedThroughputExceededException', # dynamodb 'TransactionInProgressException', # dynamodb 'RequestLimitExceeded', # ec2 'BandwidthLimitExceeded', # cloud search 'LimitExceededException', # kinesis 'TooManyRequestsException', # batch 'PriorRequestNotComplete', # route53 ])
- CHECKSUM_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new([ 'CRC32CheckFailed', # dynamodb ])
- NETWORKING_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new([ 'RequestTimeout', # s3 'IDPCommunicationError', # sts ])
Instance Method Summary collapse
- #checksum? ⇒ Boolean private
- #endpoint_discovery?(context) ⇒ Boolean private
- #expired_credentials? ⇒ Boolean private
-
#initialize(error, http_status_code) ⇒ ErrorInspector
constructor
private
A new instance of ErrorInspector.
- #networking? ⇒ Boolean private
- #retryable?(context) ⇒ Boolean private
- #server? ⇒ Boolean private
- #throttling_error? ⇒ Boolean private
Constructor Details
#initialize(error, http_status_code) ⇒ ErrorInspector
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ErrorInspector.
102 103 104 105 106 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 102 def initialize(error, http_status_code) @error = error @name = extract_name(error) @http_status_code = http_status_code end |
Instance Method Details
#checksum? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
116 117 118 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 116 def checksum? CHECKSUM_ERRORS.include?(@name) || @error.is_a?(Errors::ChecksumError) end |
#endpoint_discovery?(context) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 130 def endpoint_discovery?(context) return false unless context.operation.endpoint_discovery if @http_status_code == 421 || extract_name(@error) == 'InvalidEndpointException' @error = Errors::EndpointDiscoveryError.new end # When endpoint discovery error occurs # evict the endpoint from cache if @error.is_a?(Errors::EndpointDiscoveryError) key = context.config.endpoint_cache.extract_key(context) context.config.endpoint_cache.delete(key) true else false end end |
#expired_credentials? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
108 109 110 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 108 def expired_credentials? !!(EXPIRED_CREDS.include?(@name) || @name.match(/expired/i)) end |
#networking? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
120 121 122 123 124 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 120 def networking? @error.is_a?(Seahorse::Client::NetworkingError) || @error.is_a?(Errors::NoSuchEndpointError) || NETWORKING_ERRORS.include?(@name) end |
#retryable?(context) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
149 150 151 152 153 154 155 156 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 149 def retryable?(context) (expired_credentials? and refreshable_credentials?(context)) or throttling_error? or checksum? or networking? or server? or endpoint_discovery?(context) end |
#server? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
126 127 128 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 126 def server? (500..599).include?(@http_status_code) end |
#throttling_error? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
112 113 114 |
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 112 def throttling_error? !!(THROTTLING_ERRORS.include?(@name) || @name.match(/throttl/i) || @http_status_code == 429) end |