Exception: Pay::Braintree::Error

Inherits:
Error
  • Object
show all
Defined in:
lib/pay/braintree.rb

Direct Known Subclasses

AuthorizationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
15
16
# File 'lib/pay/braintree.rb', line 9

def initialize(result)
  if result.is_a?(::Braintree::ErrorResult)
    super(result.message)
    @result = result
  else
    super
  end
end

Instance Attribute Details

#resultObject (readonly)

For any manually raised Braintree error results (for failure responses) we can raise this exception manually but treat it as if we wrapped an exception



7
8
9
# File 'lib/pay/braintree.rb', line 7

def result
  @result
end

Instance Method Details

#causeObject



18
19
20
# File 'lib/pay/braintree.rb', line 18

def cause
  super || result
end