Exception: NWS::APIError
Overview
Error raised when the NWS API returns an error response
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response_body ⇒ String?
readonly
Raw response body from the API.
-
#status_code ⇒ Integer?
readonly
HTTP status code from the API response.
Instance Method Summary collapse
-
#initialize(message, status_code: nil, response_body: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message, status_code: nil, response_body: nil) ⇒ APIError
Returns a new instance of APIError.
18 19 20 21 22 |
# File 'lib/nws/errors.rb', line 18 def initialize(, status_code: nil, response_body: nil) @status_code = status_code @response_body = response_body super() end |
Instance Attribute Details
#response_body ⇒ String? (readonly)
Returns Raw response body from the API.
13 14 15 |
# File 'lib/nws/errors.rb', line 13 def response_body @response_body end |
#status_code ⇒ Integer? (readonly)
Returns HTTP status code from the API response.
10 11 12 |
# File 'lib/nws/errors.rb', line 10 def status_code @status_code end |