Skip to content

Commit

Permalink
Add exception to _verify_created_direct_pay_invoices (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxio authored Sep 12, 2024
1 parent 9c8368c commit 9b2ff84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jobs/payment-jobs/tasks/stale_payment_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def _verify_created_direct_pay_invoices(cls):
TransactionService.update_transaction(transaction.id, pay_response_url=None)

except HTTPError as http_err:
if http_err.response is not None and http_err.response.status_code == 404:
current_app.logger.info(f'Invoice not found (404). Skipping invoice id: {invoice.id}')
continue
current_app.logger.error(f'Error verifying invoice {invoice.id}: {http_err}', exc_info=True)
if http_err.response is None or http_err.response.status_code != 404:
current_app.logger.error(f'HTTPError on verifying invoice {invoice.id}: {http_err}', exc_info=True)
current_app.logger.info(f'Invoice not found (404) at PAYBC. Skipping invoice id: {invoice.id}')
except Exception as err: # NOQA # pylint: disable=broad-except
current_app.logger.error(f'Error verifying invoice {invoice.id}: {err}', exc_info=True)

0 comments on commit 9b2ff84

Please sign in to comment.