Exception: CyberCoach::HttpError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- CyberCoach::HttpError
- Defined in:
- lib/cybercoach/http_error.rb
Overview
Raised when a response is unsuccessful.
Instance Attribute Summary collapse
-
#cause ⇒ Object
The response that caused it.
Instance Method Summary collapse
-
#initialize(cause) ⇒ HttpError
constructor
Creates a HttpError.
-
#to_s ⇒ Object
Returns a string representation including the cause’s header and body.
Constructor Details
#initialize(cause) ⇒ HttpError
Creates a HttpError.
- cause
-
The response that caused it.
15 16 17 18 |
# File 'lib/cybercoach/http_error.rb', line 15 def initialize(cause) super @cause = cause end |
Instance Attribute Details
#cause ⇒ Object
The response that caused it.
9 10 11 |
# File 'lib/cybercoach/http_error.rb', line 9 def cause @cause end |
Instance Method Details
#to_s ⇒ Object
Returns a string representation including the cause’s header and body.
23 24 25 |
# File 'lib/cybercoach/http_error.rb', line 23 def to_s "#{super}\n\t#{@cause.to_hash}\n\t#{@cause.body}" end |