Exception: ActiveMerchant::ResponseError
- Inherits:
-
ActiveMerchantError
- Object
- StandardError
- ActiveMerchantError
- ActiveMerchant::ResponseError
- Defined in:
- lib/active_merchant/errors.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, message = nil) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #to_s ⇒ Object
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, = nil) @response = response @message = end |
Instance Attribute Details
#response ⇒ Object (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_s ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/active_merchant/errors.rb', line 25 def to_s if response.kind_of?(String) if response.start_with?('Failed') return response else return "Failed with #{response}" end end return response. if response.respond_to?(:message) && response..start_with?('Failed') "Failed with #{response.code if response.respond_to?(:code)} #{response. if response.respond_to?(:message)}" end |