Exception: ActiveResource::ConnectionError

Inherits:
StandardError
  • Object
show all
Defined in:
activeresource/lib/active_resource/exceptions.rb

Overview

:nodoc:

Direct Known Subclasses

ClientError, Redirection, SSLError, ServerError, TimeoutError

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ConnectionError) initialize(response, message = nil)

Returns a new instance of ConnectionError



5
6
7
8
# File 'activeresource/lib/active_resource/exceptions.rb', line 5

def initialize(response, message = nil)
  @response = response
  @message  = message
end

Instance Attribute Details

- (Object) response (readonly)

Returns the value of attribute response



3
4
5
# File 'activeresource/lib/active_resource/exceptions.rb', line 3

def response
  @response
end

Instance Method Details

- (Object) to_s



10
11
12
13
14
15
# File 'activeresource/lib/active_resource/exceptions.rb', line 10

def to_s
  message = "Failed."
  message << "  Response code = #{response.code}." if response.respond_to?(:code)
  message << "  Response message = #{response.message}." if response.respond_to?(:message)
  message
end