Exception: Http::Exceptions::HttpException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/http/exceptions/http_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @original_exception = options[:original_exception]
  @response = options[: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_exceptionObject (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

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/http/exceptions/http_exception.rb', line 4

def response
  @response
end