@private
@return [Integer] The HTTP status code returned by the AWS service.
@return [String] The error message given by the AWS service.
# File lib/aws/errors.rb, line 98 def initialize(req = nil, resp = nil) if req.kind_of?(String) # makes it easier to test handling of modeled exceptions super(nil, nil, req) @message = req elsif req and resp super(req, resp, message) include_error_type parse_body(resp.body) else super() end end
# File lib/aws/errors.rb, line 128 def error_grammar self.class::BASE_ERROR_GRAMMAR end
# File lib/aws/errors.rb, line 124 def extract_message(body) error_grammar.parse(body).message end
# File lib/aws/errors.rb, line 112 def include_error_type if http_response.status >= 500 extend ServerError else extend ClientError end end
# File lib/aws/errors.rb, line 120 def parse_body(body) error_grammar.parse(body, :context => self) end