Exception: HttpClient::ExceptionWithResponse
- Defined in:
- lib/http_client/exceptions.rb
Overview
Base HttpClient exception when there’s a response available
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #http_code ⇒ Object
-
#initialize(response = nil) ⇒ ExceptionWithResponse
constructor
A new instance of ExceptionWithResponse.
Methods inherited from Exception
Constructor Details
#initialize(response = nil) ⇒ ExceptionWithResponse
Returns a new instance of ExceptionWithResponse.
14 15 16 |
# File 'lib/http_client/exceptions.rb', line 14 def initialize(response=nil) @response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
12 13 14 |
# File 'lib/http_client/exceptions.rb', line 12 def response @response end |
Instance Method Details
#http_code ⇒ Object
18 19 20 |
# File 'lib/http_client/exceptions.rb', line 18 def http_code @response.code.to_i if @response end |