Skip to content

Commit

Permalink
Logging changes part3 (#1745)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Sep 12, 2024
1 parent 96cfc24 commit 9c8368c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions jobs/payment-jobs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jobs/payment-jobs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
pay-api = {git = "https://github.com/seeker25/sbc-pay.git", branch = "fix_logging_404_etc", subdirectory = "pay-api"}
pay-api = {git = "https://github.com/seeker25/sbc-pay.git", branch = "logging_changes_part3", subdirectory = "pay-api"}
flask = "^3.0.2"
flask-sqlalchemy = "^3.1.1"
sqlalchemy = "^2.0.28"
Expand Down
6 changes: 3 additions & 3 deletions pay-api/src/pay_api/services/oauth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def post(endpoint, token, auth_header_type: AuthHeaderType, # pylint: disable=t
raise ServiceUnavailableException(exc) from exc
except HTTPError as exc:
current_app.logger.error(
f"HTTPError on POST with status code {exc.response.status_code if exc.response else ''}")
f"HTTPError on POST with status code {exc.response.status_code if exc.response is not None else ''}")
if exc.response and exc.response.status_code >= 500:
raise ServiceUnavailableException(exc) from exc
raise exc
Expand Down Expand Up @@ -123,9 +123,9 @@ def get(endpoint, token, auth_header_type: AuthHeaderType, # pylint:disable=too
current_app.logger.error(exc)
raise ServiceUnavailableException(exc) from exc
except HTTPError as exc:
if not exc.response or exc.response.status_code != 404:
if exc.response is None or exc.response.status_code != 404:
current_app.logger.error('HTTPError on GET with status code '
f"{exc.response.status_code if exc.response else ''}")
f"{exc.response.status_code if exc.response is not None else ''}")
if exc.response is not None:
if exc.response.status_code >= 500:
raise ServiceUnavailableException(exc) from exc
Expand Down

0 comments on commit 9c8368c

Please sign in to comment.