Exception: Http::Exceptions::HttpException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Http::Exceptions::HttpException
- Defined in:
- lib/http/exceptions/http_exception.rb
Instance Attribute Summary collapse
-
#original_exception ⇒ Object
readonly
Returns the value of attribute original_exception.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ HttpException
constructor
A new instance of HttpException.
Constructor Details
#initialize(options = {}) ⇒ HttpException
Returns a new instance of HttpException.
6 7 8 9 10 11 12 13 |
# File 'lib/http/exceptions/http_exception.rb', line 6 def initialize( = {}) @original_exception = [:original_exception] @response = [:response] msg = 'An error has occurred while processing response.' msg += " Status #{response.code}\n#{response.body}" if response msg += " Original Exception: #{original_exception}" if original_exception super msg end |
Instance Attribute Details
#original_exception ⇒ Object (readonly)
Returns the value of attribute original_exception.
4 5 6 |
# File 'lib/http/exceptions/http_exception.rb', line 4 def original_exception @original_exception end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/http/exceptions/http_exception.rb', line 4 def response @response end |