Exception: ActiveMerchant::ResponseError

Inherits:
ActiveMerchantError show all
Defined in:
lib/active_merchant/errors.rb

Overview

:nodoc:

Direct Known Subclasses

OAuthResponseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ ResponseError

Returns a new instance of ResponseError.



20
21
22
23
# File 'lib/active_merchant/errors.rb', line 20

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

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



18
19
20
# File 'lib/active_merchant/errors.rb', line 18

def response
  @response
end

Instance Method Details

#to_sObject



25
26
27
# File 'lib/active_merchant/errors.rb', line 25

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