Exception: Philiprehberger::HttpClient::HttpError
- Defined in:
- lib/philiprehberger/http_client/errors.rb
Overview
Raised when a response status does not match expected values.
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ HttpError
constructor
A new instance of HttpError.
Constructor Details
#initialize(response) ⇒ HttpError
Returns a new instance of HttpError.
22 23 24 25 |
# File 'lib/philiprehberger/http_client/errors.rb', line 22 def initialize(response) @response = response super("HTTP #{response.status}: #{response.body.to_s[0..200]}") end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
19 20 21 |
# File 'lib/philiprehberger/http_client/errors.rb', line 19 def response @response end |