Exception: Weatherb::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Weatherb::Error
- Defined in:
- lib/weatherb/error.rb
Overview
Custom error class for rescuing from all Weatherb errors
Direct Known Subclasses
BadRequest, ClientError, Forbidden, InternalServerError, NilStatusError, ServerError, TooManyRequests, Unauthorized
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message, status_code) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status_code) ⇒ Error
Returns a new instance of Error.
8 9 10 11 12 13 14 |
# File 'lib/weatherb/error.rb', line 8 def initialize(, status_code) # Call the parent's constructor to set the message super() # Store the status_code in an instance variable @status_code = status_code end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
6 7 8 |
# File 'lib/weatherb/error.rb', line 6 def status_code @status_code end |