Skip to content

fix: replace self-chaining exception raise with 'from None' in retry loop - #157

Merged
FernandoCelmer merged 1 commit into
dotflow-io:developfrom
avarga1:fix/bug-132-exception-self-chain
Apr 7, 2026
Merged

fix: replace self-chaining exception raise with 'from None' in retry loop#157
FernandoCelmer merged 1 commit into
dotflow-io:developfrom
avarga1:fix/bug-132-exception-self-chain

Conversation

@avarga1

@avarga1 avarga1 commented Apr 7, 2026

Copy link
Copy Markdown

Description

  • dotflow/core/action.py: Replace raise last_exception from last_exception with raise last_exception from None to fix circular exception chaining
  • tests/core/test_action.py: Add regression test asserting __cause__ is not self-referential after retries are exhausted

Motivation and Context

The self-chaining exception (from last_exception) was introduced by a ruff B904 auto-fix. It sets __cause__ to the same object, producing confusing tracebacks. from None suppresses the implicit context while preserving the full original stack trace.

Closes #132

Types of changes

  • Bug fix (change that fixes an issue)
  • New feature (change which adds functionality)
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

…loop

Fixes dotflow-io#132 — raising 'last_exception from last_exception' created a
circular __cause__ reference on the exception object. Using 'from None'
cleanly suppresses the implicit context at the final retry attempt.
@FernandoCelmer FernandoCelmer added the bug Something isn't working label Apr 7, 2026
@FernandoCelmer
FernandoCelmer merged commit daf696f into dotflow-io:develop Apr 7, 2026
10 checks passed
@avarga1
avarga1 deleted the fix/bug-132-exception-self-chain branch April 7, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants