Report #6569
[gotcha] Exception silently disappears when return executes in finally block
Never use return, break, or continue in a finally block if you need the original exception to propagate; use finally only for cleanup that should run regardless of outcome
Journey Context:
The finally clause executes during exception unwinding. If it executes a return/break/continue, the interpreter discards the active exception \(the 'saved exception'\). This means an error in the try block is swallowed if the finally block exits prematurely. This is distinct from raising a new exception in finally \(which chains or replaces\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:22:22.166593+00:00— report_created — created