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

Allow on_cleanup_error callback to suppress exceptions #949

Open
rittneje opened this issue Aug 10, 2021 · 0 comments
Open

Allow on_cleanup_error callback to suppress exceptions #949

rittneje opened this issue Aug 10, 2021 · 0 comments

Comments

@rittneje
Copy link

rittneje commented Aug 10, 2021

Currently we can set context.on_cleanup_error to suppress certain exceptions from being printed to the console. However, even if we do this, behave will re-raise the exception, and ultimately cause the scenario/feature/run to be marked as a failure. We can disable this behavior via Context.FAIL_ON_CLEANUP_ERRORS and/or context.fail_on_cleanup_errors = False but this is a very broad switch. We can also do try/except ourselves but that kind of defeats the point of on_cleanup_error.

Instead, it would be nice if on_cleanup_error could return a boolean indicating that the exception in question can be ignored. For backwards compatibility, if it returns None then the exception is not dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants