Class: AWS::SES::Error
- Defined in:
- lib/aws/ses/response.rb
Overview
Requests whose response code is between 300 and 599 and contain an <Error></Error> in their body are wrapped in an Error::Response. This Error::Response contains an Error object which raises an exception that corresponds to the error in the response body. The exception object contains the ErrorResponse, so in all cases where a request happens, you can rescue ResponseError and have access to the ErrorResponse and its Error object which contains information about the ResponseError.
begin
Bucket.create(..)
rescue ResponseError => exception
exception.response
# => <Error::Response>
exception.response.error
# => <Error>
end
Instance Attribute Summary
Attributes inherited from Response
#action, #body, #parsed, #response
Instance Method Summary collapse
Methods inherited from Response
#[], #code, #each, #error, #headers, #initialize, #result
Constructor Details
This class inherits a constructor from AWS::SES::Response
Instance Method Details
#error? ⇒ Boolean
87 88 89 |
# File 'lib/aws/ses/response.rb', line 87 def error? true end |
#inspect ⇒ Object
91 92 93 |
# File 'lib/aws/ses/response.rb', line 91 def inspect "#<%s:0x%s %s %s: '%s'>" % [self.class.name, object_id, response.code, error.code, error.] end |