Class: LedgerSync::QuickBooksOnline::Util::LedgerErrorParser::AuthenticationMatcher

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



25
26
27
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 25

def error_class
  Error::LedgerError::AuthenticationError
end

#match?Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
39
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 33

def match?
  code == 3200 ||
    code == '3200' ||
    message.downcase.include?('statuscode=401') ||
    message.downcase.include?('authenticationfailed') ||
    message.downcase.include?('errorcode=003200')
end

#output_messageObject



29
30
31
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 29

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