Exception: Amadeus::ResponseError Abstract

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/amadeus/client/errors.rb

Overview

This class is abstract.

A custom generic Amadeus error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeString (readonly)

A unique code for this type of error. Options include NetworkError, ParserError, ServerError, AuthenticationError, NotFoundError and UnknownError.

Returns:

  • (String)


19
20
21
# File 'lib/amadeus/client/errors.rb', line 19

def code
  @code
end

#responseAmadeus::Response (readonly)

The response object containing the raw HTTP response and the request used to make the API call.

Returns:



12
13
14
# File 'lib/amadeus/client/errors.rb', line 12

def response
  @response
end

Instance Method Details

#log(client) ⇒ Object

PROTECTED



36
37
38
39
40
41
42
43
44
# File 'lib/amadeus/client/errors.rb', line 36

def log(client)
  # :nocov:
  return unless client.log_level == 'warn'

  client.logger.warn("Amadeus #{@code}") do
    JSON.pretty_generate(@description) if @description
  end
  # :nocov:
end