Exception: RestClient::RequestFailed
- Inherits:
-
ExceptionWithResponse
- Object
- RuntimeError
- Exception
- ExceptionWithResponse
- RestClient::RequestFailed
- Defined in:
- lib/restclient/exceptions.rb
Overview
The request failed, meaning the remote HTTP server returned a code other than success, unauthorized, or redirect.
The exception message attempts to extract the error from the XML, using format returned by Rails: <errors><error>some message</error></errors>
You can get the status code by e.http_code, or see anything about the response via e.response. For example, the entire result body (which is probably an HTML error page) is e.response.body.
Instance Attribute Summary
Attributes inherited from ExceptionWithResponse
Instance Method Summary collapse
Methods inherited from ExceptionWithResponse
#http_body, #http_code, #initialize
Constructor Details
This class inherits a constructor from RestClient::ExceptionWithResponse
Instance Method Details
#message ⇒ Object
74 75 76 |
# File 'lib/restclient/exceptions.rb', line 74 def "HTTP status code #{http_code}" end |
#to_s ⇒ Object
78 79 80 |
# File 'lib/restclient/exceptions.rb', line 78 def to_s end |