Exception: ActiveMerchant::ResponseError

Inherits:
ActiveMerchantError show all
Defined in:
lib/active_merchant/common/error.rb,
lib/active_merchant/common/connection.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ ResponseError

Returns a new instance of ResponseError.



14
15
16
17
# File 'lib/active_merchant/common/error.rb', line 14

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

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/active_merchant/common/error.rb', line 12

def response
  @response
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/active_merchant/common/error.rb', line 19

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