Skip to content

Commit

Permalink
Fix for bcol logging. (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Feb 21, 2023
1 parent cd69684 commit 1eab2f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pay-api/src/pay_api/services/bcol_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def create_invoice(self, payment_account: PaymentAccount, # pylint: disable=too
current_app.logger.debug(f'BCOL Response : {response_json}')
pay_response.raise_for_status()
except HTTPError as bol_err:
current_app.logger.error(bol_err)
error_type: str = response_json.get('type')
if error_type.isdigit():
error = get_bcol_error(int(error_type))
error_type: str = response_json.get('type', '-1')
error = get_bcol_error(int(error_type))
if error in [Error.BCOL_ERROR, Error.BCOL_UNAVAILABLE]:
current_app.logger.error(bol_err)
else:
error = Error.BCOL_ERROR
current_app.logger.warning(bol_err)
raise BusinessException(error) from bol_err

invoice_reference: InvoiceReference = InvoiceReference.create(invoice.id, response_json.get('key'),
Expand Down

0 comments on commit 1eab2f8

Please sign in to comment.