Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Handle server startup failure in __enter__ #274

Merged
merged 1 commit into from
May 31, 2024

Conversation

dbarbuzzi
Copy link

With a context manager class, the __exit__ method is not called when an exception is raised during the context manager’s __enter__ method. This PR addresses that by manually calling that method if an exception is raised.

@dbarbuzzi dbarbuzzi self-assigned this May 31, 2024
Copy link
Member

@andy-neuma andy-neuma left a comment

Choose a reason for hiding this comment

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

cool. good pick up.

@dbarbuzzi dbarbuzzi marked this pull request as ready for review May 31, 2024 14:44
@dbarbuzzi dbarbuzzi merged commit 0194675 into main May 31, 2024
12 checks passed
@dbarbuzzi dbarbuzzi deleted the fix-server-context-manager branch May 31, 2024 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants