Skip to content

Change panic behavior to the default of unwind#10228

Merged
jtran merged 1 commit intomainfrom
jtran/panic-unwind
Mar 3, 2026
Merged

Change panic behavior to the default of unwind#10228
jtran merged 1 commit intomainfrom
jtran/panic-unwind

Conversation

@jtran
Copy link
Contributor

@jtran jtran commented Feb 27, 2026

Related: #10121.

The primary motivation of this is so that Python code using the bindings can catch any panics in the Rust code, rather than the panic aborting the process.

  • Test to verify it actually raises PanicException. I did this locally, but I don't think it's worth committing since it requires triggering a panic. Also, I learned that for async Rust, we handle it and raise Exception instead. But it's not guaranteed, so it's good to catch PanicException also.
    .map_err(|err| PyException::new_err(err.to_string()))?

Note: wasm32-unknown-unknown doesn't currently implement unwinding, so that target is unaffected by this change. https://doc.rust-lang.org/rustc/platform-support/wasm32-unknown-unknown.html#unwinding

It was originally set in #207.

@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeling-app Ready Ready Preview, Comment Mar 3, 2026 6:13pm

Request Review

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will not alter performance

✅ 166 untouched benchmarks
⏩ 93 skipped benchmarks1


Comparing jtran/panic-unwind (4042b6a) with main (0e164ec)2

Open in CodSpeed

Footnotes

  1. 93 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (092129a) during the generation of this report, so 0e164ec was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Related: #10121.

Note: wasm32-unknown-unknown doesn't currently implement unwinding, so that target is unaffected by this change. https://doc.rust-lang.org/rustc/platform-support/wasm32-unknown-unknown.html#unwinding
@jtran jtran force-pushed the jtran/panic-unwind branch from cd482cf to 4042b6a Compare March 3, 2026 17:56
@jtran jtran marked this pull request as ready for review March 3, 2026 17:59
@jtran jtran requested a review from a team as a code owner March 3, 2026 17:59
@jtran jtran merged commit 8983765 into main Mar 3, 2026
78 checks passed
@jtran jtran deleted the jtran/panic-unwind branch March 3, 2026 21:46
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.

2 participants