Exception: Amadeus::ResponseError Abstract
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Amadeus::ResponseError
- Defined in:
- lib/amadeus/client/errors.rb
Overview
This class is abstract.
A custom generic Amadeus error.
Direct Known Subclasses
AuthenticationError, ClientError, NetworkError, NotFoundError, ParserError, ServerError
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
A unique code for this type of error.
-
#response ⇒ Amadeus::Response
readonly
The response object containing the raw HTTP response and the request used to make the API call.
Instance Method Summary collapse
-
#log(client) ⇒ Object
PROTECTED.
Instance Attribute Details
#code ⇒ String (readonly)
A unique code for this type of error. Options include NetworkError
, ParserError
, ServerError
, AuthenticationError
, NotFoundError
and UnknownError
.
19 20 21 |
# File 'lib/amadeus/client/errors.rb', line 19 def code @code end |
#response ⇒ Amadeus::Response (readonly)
The response object containing the raw HTTP response and the request used to make the API call.
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 |
# 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 |