Exception: Shep::Error::Http
- Inherits:
-
Server
- Object
- RuntimeError
- Shep::Error
- Server
- Shep::Error::Http
- Defined in:
- lib/shep/exceptions.rb
Overview
Thrown when the HTTP library returns an error response.
Basically the same meaning as Error::Server but also includes the response object for your perusal.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Http
constructor
A new instance of Http.
Constructor Details
#initialize(response) ⇒ Http
Returns a new instance of Http.
43 44 45 46 47 48 49 50 51 |
# File 'lib/shep/exceptions.rb', line 43 def initialize(response) msg = "HTTP Error #{response.class}" errmsg = find_error_msg_if_present(response) msg += ": #{errmsg}" if errmsg != "" super(msg) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
42 43 44 |
# File 'lib/shep/exceptions.rb', line 42 def response @response end |