class AWS::ElasticTranscoder::Client

Constants

CACHEABLE_REQUESTS

@private

Public Instance Methods

extract_error_details(response) click to toggle source

@private

# File lib/aws/elastic_transcoder/client.rb, line 20
def extract_error_details response
  if
    response.http_response.status >= 300 and
    body = response.http_response.body and
    json = (::JSON.load(body) rescue nil)
  then
    headers = response.http_response.headers
    code = headers['x-amzn-errortype'].first.split(':')[0]
    message = json['message'] || json['Message']
    [code, message]
  end
end