Class: LedgerSync::QuickBooksOnline::Util::LedgerErrorParser::ThrottleMatcher

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



10
11
12
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 10

def error_class
  Error::LedgerError::ThrottleError
end

#match?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 18

def match?
  message.include?('source=throttling policy') ||
    message.include?('errorcode=003001')
end

#output_messageObject



14
15
16
# File 'lib/ledger_sync/quickbooks_online/util/ledger_error_parser.rb', line 14

def output_message
  "Request throttle with: #{error_message}"
end