Method: AppnexusApi::Faraday::Response::RaiseHttpError#error_message

Defined in:
lib/appnexusapi/faraday/raise_http_error.rb

#error_message(response) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/appnexusapi/faraday/raise_http_error.rb', line 30

def error_message(response)
  msg = "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:status]}"
  if errors = response[:body] && response[:body]["errors"]
    msg << "\n"
    msg << errors.join("\n")
  end
  msg
end