Method: WCC::Contentful::SimpleClient::Response#error_message

Defined in:
lib/wcc/contentful/simple_client/response.rb

#error_messageObject



24
25
26
27
28
29
30
31
32
# File 'lib/wcc/contentful/simple_client/response.rb', line 24

def error_message
  parsed_message =
    begin
      raw['message']
    rescue JSON::ParserError
      nil
    end
  parsed_message || "#{code}: #{raw_response.body}"
end