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.
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.
40 41 42 43 44 45 46 47 48 |
# File 'lib/shep/exceptions.rb', line 40 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.
39 40 41 |
# File 'lib/shep/exceptions.rb', line 39 def response @response end |