Exception: ActiveResource::ConnectionError

Inherits:
StandardError
  • Object
show all
Defined in:
activeresource/lib/active_resource/connection.rb,
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



11
12
13
14
# File 'activeresource/lib/active_resource/connection.rb', line 11

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

Instance Attribute Details

- (Object) response (readonly)

Returns the value of attribute response



9
10
11
# File 'activeresource/lib/active_resource/connection.rb', line 9

def response
  @response
end

Instance Method Details

- (Object) to_s



16
17
18
# File 'activeresource/lib/active_resource/connection.rb', line 16

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