Exception: TravelTimeAPI::BadRequest
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- TravelTimeAPI::BadRequest
- Defined in:
- lib/traveltime_api.rb
Overview
Raised if API user made bad request.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Server provided String code for this error.
-
#details ⇒ Object
readonly
Server provided String explanation of error.
Instance Method Summary collapse
-
#initialize(code, details) ⇒ BadRequest
constructor
A new instance of BadRequest.
- #to_s ⇒ Object
Constructor Details
#initialize(code, details) ⇒ BadRequest
Returns a new instance of BadRequest.
30 31 32 33 |
# File 'lib/traveltime_api.rb', line 30 def initialize(code, details) @code = code @details = details end |
Instance Attribute Details
#code ⇒ Object (readonly)
Server provided String code for this error.
26 27 28 |
# File 'lib/traveltime_api.rb', line 26 def code @code end |
#details ⇒ Object (readonly)
Server provided String explanation of error.
28 29 30 |
# File 'lib/traveltime_api.rb', line 28 def details @details end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/traveltime_api.rb', line 35 def to_s "TravelTimeAPI::BadRequest[#{@code}: #{details}]" end |