Class: LedgerSync::Ledgers::TestLedger::Util::LedgerErrorParser::AuthorizationMatcher

Inherits:
ErrorMatcher
  • Object
show all
Defined in:
lib/ledger_sync/test/support/test_ledger/util/ledger_error_parser.rb

Instance Attribute Summary

Attributes inherited from ErrorMatcher

#error, #message

Instance Method Summary collapse

Methods inherited from ErrorMatcher

#body, #code, #detail, #error_message, #initialize

Constructor Details

This class inherits a constructor from LedgerSync::Ledgers::TestLedger::Util::ErrorMatcher

Instance Method Details

#error_classObject



42
43
44
# File 'lib/ledger_sync/test/support/test_ledger/util/ledger_error_parser.rb', line 42

def error_class
  Error::LedgerError::AuthorizationError
end

#match?Boolean

Returns:

  • (Boolean)


50
51
52
53
54
# File 'lib/ledger_sync/test/support/test_ledger/util/ledger_error_parser.rb', line 50

def match?
  code == 3100 ||
    message.include?('authorizationfailed') ||
    message.include?('errorcode=003100')
end

#output_messageObject



46
47
48
# File 'lib/ledger_sync/test/support/test_ledger/util/ledger_error_parser.rb', line 46

def output_message
  "Authorization Failed with: #{error_message}"
end