Class: LedgerSync::QuickBooksOnline::Util::LedgerErrorParser::AuthorizationMatcher

Inherits:
ErrorMatcher
  • Object
show all
Defined in:
lib/ledger_sync/quickbooks_online/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, #parsed_body

Constructor Details

This class inherits a constructor from LedgerSync::QuickBooksOnline::Util::ErrorMatcher

Instance Method Details

#error_classObject



43
44
45
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 43

def error_class
  Error::LedgerError::AuthorizationError
end

#match?Boolean

Returns:

  • (Boolean)


51
52
53
54
55
56
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 51

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

#output_messageObject



47
48
49
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 47

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