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

Catch closing exceptions #162

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Catch closing exceptions #162

merged 3 commits into from
Nov 27, 2024

Conversation

sidnarayanan
Copy link
Collaborator

Extending catch_env_failures to cover env.close(). I just lost a ~24h training because a remote env failed to close, so I want to protect against that.


If catch_env_failures is set, will not raise exceptions.
"""
with suppress(EnvError), reraise_exc_as(EnvError, enabled=catch_env_failures):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this log the closing's Exception somewhere? Would be good to log it at least

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, reraise_exc_as has logging builtin. This is the same logic that we use to catch reset/step exceptions

@sidnarayanan sidnarayanan merged commit feb0222 into main Nov 27, 2024
6 checks passed
@sidnarayanan sidnarayanan deleted the catch-env-failures branch November 27, 2024 22:23
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