Exception: Resourceful::UnsuccessfulHttpRequestError
- Defined in:
- lib/resourceful/exceptions.rb
Overview
This exception used to indicate that the request did not succeed. The HTTP response is included so that the appropriate actions can be taken based on the details of that response
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http_request ⇒ Object
readonly
Returns the value of attribute http_request.
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
Instance Method Summary collapse
-
#initialize(http_request, http_response) ⇒ UnsuccessfulHttpRequestError
constructor
Initialize new error from the HTTP request and response attributes.
Constructor Details
#initialize(http_request, http_response) ⇒ UnsuccessfulHttpRequestError
Initialize new error from the HTTP request and response attributes.
11 12 13 14 15 |
# File 'lib/resourceful/exceptions.rb', line 11 def initialize(http_request, http_response) super("#{http_request.method} request to <#{http_request.uri}> failed with code #{http_response.code}") @http_request = http_request @http_response = http_response end |
Instance Attribute Details
#http_request ⇒ Object (readonly)
Returns the value of attribute http_request.
8 9 10 |
# File 'lib/resourceful/exceptions.rb', line 8 def http_request @http_request end |
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response.
8 9 10 |
# File 'lib/resourceful/exceptions.rb', line 8 def http_response @http_response end |