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

Make Retry context manager not swallow exceptions #150

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

haatveit
Copy link
Contributor

Any exception raised within the Retry context manager would just cause it to exit the code block without attempting to handle or reraise the error. This led to failures later in codepaths assuming that all the lines ran in the context of the Retry instance had actually been executed.

This change makes the class raise HTTP 500/504 errors upon reaching max attempts, as well as reraising other exceptions, so they can be handled outside of the context.

Any exception raised within the Retry context manager would just cause it to exit the code block without attempting to handle or reraise the error.

This change makes the class raise HTTP 500/504 errors upon reaching max attempts, as well as reraising other exceptions, so they can be handled outside of the context.
@haatveit haatveit requested a review from leondutoit September 11, 2024 13:47
Copy link
Collaborator

@leondutoit leondutoit left a comment

Choose a reason for hiding this comment

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

<3, ty!

@haatveit haatveit merged commit 2495a79 into unioslo:master Sep 12, 2024
1 check passed
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.

2 participants