Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling and logging for get operation status #19

Merged
merged 10 commits into from
Jul 19, 2024

Conversation

honourfish
Copy link
Collaborator

@honourfish honourfish commented Jul 19, 2024

Overview

  • Catch and handle http exceptions by logging them and carrying on the polling
  • Introduce logging and log levels

Testing

Failure with log level WARNING:

python3 ./scitt/check_operation_status.py --operation-id foo
signed statement not registered within polling duration

Failure with log level DEBUG:

python3 ./scitt/check_operation_status.py --operation-id foo --log-level DEBUG
INFO:check operation status:starting to poll for operation status 'succeeded'
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): app.datatrails.ai:443
DEBUG:urllib3.connectionpool:https://app.datatrails.ai:443 "GET /archivist/v1/publicscitt/operations/foo HTTP/1.1" 400 47
DEBUG:check operation status:failed getting operation status, error: 400 Client Error: Bad Request for url: https://app.datatrails.ai/archivist/v1/publicscitt/operations/foo
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): app.datatrails.ai:443
DEBUG:urllib3.connectionpool:https://app.datatrails.ai:443 "GET /archivist/v1/publicscitt/operations/foo HTTP/1.1" 400 47
DEBUG:check operation status:failed getting operation status, error: 400 Client Error: Bad Request for url: https://app.datatrails.ai/archivist/v1/publicscitt/operations/foo
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): app.datatrails.ai:443
DEBUG:urllib3.connectionpool:https://app.datatrails.ai:443 "GET /archivist/v1/publicscitt/operations/foo HTTP/1.1" 400 47
DEBUG:check operation status:failed getting operation status, error: 400 Client Error: Bad Request for url: https://app.datatrails.ai/archivist/v1/publicscitt/operations/foo
...

Copy link
Collaborator

@robinbryce robinbryce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would do much better to hide the python specific traceback sytax

robinbryce
robinbryce previously approved these changes Jul 19, 2024
Copy link
Collaborator

@robinbryce robinbryce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@honourfish honourfish requested a review from robinbryce July 19, 2024 12:23
@honourfish honourfish enabled auto-merge (squash) July 19, 2024 12:24
Copy link
Collaborator

@robinbryce robinbryce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@honourfish honourfish merged commit 5bb325a into main Jul 19, 2024
10 checks passed
@honourfish honourfish deleted the dev/jgough/better-errhandling-get-operation-status branch July 19, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants