Exception: AWS::Errors::Base

Inherits:
StandardError
  • Object
show all
Defined in:
lib/aws/errors.rb

Overview

Base class for the two service error classes:

When interacting with Amazon AWS services, you will sometimes receive a non-200 level response. These http responses are treated as errors.

Client Errors

Errors in the three and four hundreds are client errors (ClientError). A client error should not be resent without changes. The body of the http response (the error #message) should give more information about the nature of the problem.

Server Errors

A 500 level error typically indicates the service is having an issue.

Requests that generate service errors are automatically retried with an exponential backoff. If the service still fails to respond with a 200 after 3 retries the error is raised.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_request, http_response, message = http_response.body) ⇒ Base

Returns a new instance of Base.



54
55
56
57
58
# File 'lib/aws/errors.rb', line 54

def initialize http_request, http_response, message = http_response.body
  @http_request = http_request
  @http_response = http_response
  super(message)
end

Instance Attribute Details

#http_requestHttp::Request (readonly)

Returns The low level http request that caused the error to be raised.

Returns:

  • (Http::Request)

    The low level http request that caused the error to be raised.



48
49
50
# File 'lib/aws/errors.rb', line 48

def http_request
  @http_request
end

#http_responseHttp::Response (readonly)

Returns The low level http response from the service that wrapped the service error.

Returns:

  • (Http::Response)

    The low level http response from the service that wrapped the service error.



52
53
54
# File 'lib/aws/errors.rb', line 52

def http_response
  @http_response
end