Exception: OldApiResource::ConnectionError
- Inherits:
-
StandardError
- Object
- StandardError
- OldApiResource::ConnectionError
- Defined in:
- lib/old_api_resource/exceptions.rb
Overview
:nodoc:
Direct Known Subclasses
ClientError, Redirection, RequestTimeout, SSLError, ServerError
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #http_code ⇒ Object
-
#initialize(response, message = nil) ⇒ ConnectionError
constructor
A new instance of ConnectionError.
- #to_s ⇒ Object
Constructor Details
#initialize(response, message = nil) ⇒ ConnectionError
Returns a new instance of ConnectionError.
8 9 10 11 |
# File 'lib/old_api_resource/exceptions.rb', line 8 def initialize(response, = nil) @response = response @message = end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/old_api_resource/exceptions.rb', line 6 def response @response end |
Instance Method Details
#http_code ⇒ Object
20 21 22 |
# File 'lib/old_api_resource/exceptions.rb', line 20 def http_code self.class.http_code end |
#to_s ⇒ Object
13 14 15 16 17 18 |
# File 'lib/old_api_resource/exceptions.rb', line 13 def to_s = "Failed." << " Response code = #{response.code}." if response.respond_to?(:code) << " Response message = #{response.}." if response.respond_to?(:message) << "\n#{@message}" end |