Exception: TravelTimeAPI::ServerError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- TravelTimeAPI::ServerError
- Defined in:
- lib/traveltime_api.rb
Overview
Raised if API server has encountered an error.
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Human readable error message.
-
#http_code ⇒ Object
readonly
Human readable error message.
Instance Method Summary collapse
-
#initialize(error, http_code) ⇒ ServerError
constructor
A new instance of ServerError.
- #to_s ⇒ Object
Constructor Details
#initialize(error, http_code) ⇒ ServerError
Returns a new instance of ServerError.
51 52 53 54 |
# File 'lib/traveltime_api.rb', line 51 def initialize(error, http_code) @error = error @http_code = http_code end |
Instance Attribute Details
#error ⇒ Object (readonly)
Human readable error message.
49 50 51 |
# File 'lib/traveltime_api.rb', line 49 def error @error end |
#http_code ⇒ Object (readonly)
Human readable error message.
49 50 51 |
# File 'lib/traveltime_api.rb', line 49 def http_code @http_code end |
Instance Method Details
#to_s ⇒ Object
56 57 58 |
# File 'lib/traveltime_api.rb', line 56 def to_s "TravelTimeAPI::ServerError[http code: #{@http_code} | #{@error}]" end |