Exception: Balanced::UnassociatedCardError

Inherits:
StandardError show all
Defined in:
lib/balanced/error.rb

Overview

Raised when attempted to create a debit or hold for a card not associated to an account

Instance Attribute Summary

Attributes inherited from StandardError

#message

Attributes inherited from Error

#response

Instance Method Summary collapse

Methods inherited from Error

#body

Constructor Details

#initialize(card) ⇒ UnassociatedCardError

Returns a new instance of UnassociatedCardError.

Parameters:



55
56
57
58
# File 'lib/balanced/error.rb', line 55

def initialize(card)
  @card = card
  super(error_message)
end

Instance Method Details

#error_messageObject



60
61
62
# File 'lib/balanced/error.rb', line 60

def error_message
  "The Balanced::Card with uri=#{@card.attributes['uri']} is not associated to an account"
end