module AWS::Errors::ModeledError
def error_grammar
def error_grammar self.class::BASE_ERROR_GRAMMAR end
def extract_message(body)
def extract_message(body) error_grammar.parse(body).message end
def include_error_type
def include_error_type if http_response.status >= 500 extend ServerError else extend ClientError end end
def initialize(req = nil, resp = nil)
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
def parse_body(body)
def parse_body(body) error_grammar.parse(body, :context => self) end