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 BaseException instead of Exception #641

Merged
merged 2 commits into from
May 3, 2024
Merged

Catch BaseException instead of Exception #641

merged 2 commits into from
May 3, 2024

Conversation

aleneum
Copy link
Member

@aleneum aleneum commented Oct 24, 2023

Exception is not broad enough and does not catch asyncio.CancelledError or KeyboardInterrupt. transitions will exclusively catch BaseException from now on.

This has to major implications: First on_exception is not called when a task is cancelled. This will happen when an asynchronous event cancels currently running callbacks or a KeyboardInterrupt is called. Second, when queue=True
CancelledError will not cause the queue to get cleared and render the machine unusable from thereon.

- Exception does not include KeyboardInterrupt or CancelledError
- closes #619
- closes #639
@aleneum aleneum changed the title This fixes #619 and #639 Catch BaseException instead of Exception Oct 24, 2023
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8ab2529) 98.40% compared to head (4c7ae1f) 98.40%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #641   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files          13       13           
  Lines        2573     2573           
=======================================
  Hits         2532     2532           
  Misses         41       41           
Files Coverage Δ
transitions/core.py 100.00% <100.00%> (ø)
transitions/extensions/nesting.py 99.29% <100.00%> (ø)
transitions/extensions/asyncio.py 97.77% <75.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aleneum aleneum merged commit eaa495c into master May 3, 2024
8 of 9 checks passed
@aleneum aleneum deleted the fix-#639 branch May 3, 2024 10:34
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.

1 participant