Module: AWS::Core::JSONClient::ErrorParser
- Defined in:
- lib/aws/core/json_client.rb
Instance Method Summary collapse
Instance Method Details
#extract_error_details(response) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/aws/core/json_client.rb', line 84 def extract_error_details response if response.http_response.status >= 300 and body = response.http_response.body and json = (::JSON.load(body) rescue nil) and type = json["__type"] and matches = type.match(/\#(.*)$/) then code = matches[1] if code == 'RequestEntityTooLarge' = 'Request body must be less than 1 MB' else = json['message'] end [code, ] end end |