Exception: Geoloqi::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Geoloqi::ApiError
- Defined in:
- lib/geoloqi/error.rb
Overview
Used for Geoloqi API errors (errors originating from the API server itself).
Instance Attribute Summary collapse
-
#reason ⇒ String
readonly
Human-readable explanation of error.
-
#status ⇒ Fixnum
readonly
Status code of error.
-
#type ⇒ String
readonly
Type of error.
Instance Method Summary collapse
-
#initialize(status, type, reason = nil) ⇒ ApiError
constructor
Instantiate a new ApiError object.
Constructor Details
#initialize(status, type, reason = nil) ⇒ ApiError
Instantiate a new ApiError object
24 25 26 27 28 29 30 31 32 |
# File 'lib/geoloqi/error.rb', line 24 def initialize(status, type, reason=nil) @status = status @type = type @reason = reason = type += " - #{reason}" if reason += " (#{status})" super end |
Instance Attribute Details
#reason ⇒ String (readonly)
Human-readable explanation of error.
20 21 22 |
# File 'lib/geoloqi/error.rb', line 20 def reason @reason end |
#status ⇒ Fixnum (readonly)
Status code of error
8 9 10 |
# File 'lib/geoloqi/error.rb', line 8 def status @status end |
#type ⇒ String (readonly)
Type of error
14 15 16 |
# File 'lib/geoloqi/error.rb', line 14 def type @type end |