Skip to content

fix(stageleft): re-propagate unexpected panics from invoke_quoted#80

Merged
shadaj merged 1 commit into
mainfrom
sandbox-39a40ccd-ca21-4a71-a681-24a466fd763e
Jun 19, 2026
Merged

fix(stageleft): re-propagate unexpected panics from invoke_quoted#80
shadaj merged 1 commit into
mainfrom
sandbox-39a40ccd-ca21-4a71-a681-24a466fd763e

Conversation

@shadaj

@shadaj shadaj commented Jun 19, 2026

Copy link
Copy Markdown
Member

Previously, catch_unwind swallowed all panics including ones from buggy
FreeVariable::to_tokens implementations, then failed on props.unwrap()
with "called Option::unwrap() on a None value" hiding the real cause.

Now the caught panic payload is checked against the expected
"stageleft: q!() closure completed" message. Any other panic is
re-raised via resume_unwind after restoring the hook and dropping the
mutex guard.

Also removed an unused use core::panic; import and added a unit test.

Co-authored-by: Infinity 🤖 infinity@hydro.run

@shadaj shadaj marked this pull request as ready for review June 19, 2026 21:02
…h proper backtraces

Previously, catch_unwind swallowed all panics including ones from buggy
FreeVariable::to_tokens implementations. The custom panic hook suppressed
all output, so even if the panic was re-raised there'd be no backtrace.
Then props.unwrap() would fail with an unhelpful "Option::unwrap() on None".

Now the panic hook only suppresses panics with the expected
"stageleft: q!() closure completed" message and forwards all others to
the previous hook (preserving backtraces). After catch_unwind, unexpected
panics are re-raised via resume_unwind.

Also removed an unused `use core::panic;` import and added a unit test.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #80
@shadaj shadaj force-pushed the sandbox-39a40ccd-ca21-4a71-a681-24a466fd763e branch from 787155f to 8e94b1a Compare June 19, 2026 21:24
@shadaj shadaj merged commit dd94e90 into main Jun 19, 2026
5 checks passed
@shadaj shadaj deleted the sandbox-39a40ccd-ca21-4a71-a681-24a466fd763e branch June 19, 2026 21:57
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.

3 participants