Exception: HTTP::StatusError
- Inherits:
-
ResponseError
- Object
- StandardError
- Error
- ResponseError
- HTTP::StatusError
- Defined in:
- lib/http/errors.rb
Overview
When status code indicates an error
Instance Attribute Summary collapse
-
#response ⇒ HTTP::Response
readonly
The HTTP response that caused the error.
Instance Method Summary collapse
-
#initialize(response) ⇒ StatusError
constructor
Create a new StatusError from a response.
Constructor Details
#initialize(response) ⇒ StatusError
Create a new StatusError from a response
45 46 47 48 49 |
# File 'lib/http/errors.rb', line 45 def initialize(response) @response = response super("Unexpected status code #{response.code}") end |
Instance Attribute Details
#response ⇒ HTTP::Response (readonly)
The HTTP response that caused the error
35 36 37 |
# File 'lib/http/errors.rb', line 35 def response @response end |