class AWS::SES::ResponseError

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

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
Calls superclass method
# File lib/aws/ses/response.rb, line 91
def initialize(response)
  @response = response
  super("AWS::SES Response Error: #{message}")
end

Public Instance Methods

code() click to toggle source
# File lib/aws/ses/response.rb, line 96
def code
  @response.code
end
inspect() click to toggle source
# File lib/aws/ses/response.rb, line 104
def inspect
  "#<%s:0x%s %s %s '%s'>" % [self.class.name, object_id, @response.request_id, code, message]
end
message() click to toggle source
# File lib/aws/ses/response.rb, line 100
def message
  "#{@response.error['Code']} - #{@response.error['Message']}"
end