Exception: Finicity::FinicityAggregationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/finicity/errors.rb

Direct Known Subclasses

InvalidCredentialsError

Constant Summary collapse

ERROR_CODE_MAP =
{
  '0' => 'Success.',
  '102' => 'Retry error. Website is down or there is a connectivity issue.',
  '103' => 'Invalid Credentials. Credentials must be updated.',
  '106' => 'Account Name/Number/Type mismatch.',
  '108' => 'End user action required at the third party site.',
  '109' => 'Password change required at the third party site.',
  '185' => 'MFA answer(s) missing.',
  '187' => 'Incorrect answer to MFA challenge question.'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aggregation_status_code) ⇒ FinicityAggregationError

Returns a new instance of FinicityAggregationError.



47
48
49
# File 'lib/finicity/errors.rb', line 47

def initialize(aggregation_status_code)
  @aggregation_status_code = aggregation_status_code
end

Instance Attribute Details

#aggregation_status_codeObject (readonly)

Returns the value of attribute aggregation_status_code.



45
46
47
# File 'lib/finicity/errors.rb', line 45

def aggregation_status_code
  @aggregation_status_code
end

Instance Method Details

#error_messageObject



51
52
53
# File 'lib/finicity/errors.rb', line 51

def error_message
  ERROR_CODE_MAP[aggregation_status_code.to_s] || 'Unknown Error'
end

#to_sObject



55
56
57
# File 'lib/finicity/errors.rb', line 55

def to_s
  "[Aggregation Status Code #{aggregation_status_code}] #{error_message}"
end