Method: Codelocks::Response#error_message

Defined in:
lib/codelocks/response.rb

#error_messageString

Convenience method for fetching the error message

Returns:

  • (String)


35
36
37
38
39
40
41
# File 'lib/codelocks/response.rb', line 35

def error_message
  if !success?
    body["Message"]
  end
rescue JSON::ParserError => ex
  ex.message
end