alexcrichton opened PR #14549 from alexcrichton:catch-more-excpetions to bytecodealliance:main:
This commit updates logic to handle the
ThrownExceptionbuilt-in-error type when processing an otherwise-uncaught exception. Previously this had no special handling w.r.t. components and a consequence of that was that natural?-style error propagation would "leak" exceptions across component boundaries. Components are intended to convert any uncaught exceptions into traps at component boundaries, but due to this?-propagation it wasn't actually correctly implemented in a number of locations.Some of the new tests added in this commit are examples of where these uncaught exceptions where
?-propagated across components. One example is that when a component callstask.returnand then that callsreallocand then that throws an exception. Previously that was propagated through?meaning that an exception thrown by the callee naturally transitioned into the caller across the component boundary.The fix in this commit is intended to make
?-style propagation work-by-default with components. Namely uncaught exceptions are internally turned intoTrap::UncaughtExceptioninstead of propagating as aThrownException. This is done by annotating call-sites with what behavior is desired, where core wasm entrypoints propagateThrownExceptionand component entrypoints all turn it into a trap.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested dicej for a review on PR #14549.
alexcrichton requested wasmtime-core-reviewers for a review on PR #14549.
alexcrichton updated PR #14549.
alexcrichton updated PR #14549.
github-actions[bot] added the label wasmtime:api on PR #14549.
:thumbs_up: dicej submitted PR review.
alexcrichton added PR #14549 Don't propagate ThrownException with components to the merge queue.
github-merge-queue[bot] removed PR #14549 Don't propagate ThrownException with components from the merge queue.
alexcrichton added PR #14549 Don't propagate ThrownException with components to the merge queue.
:check: alexcrichton merged PR #14549.
alexcrichton removed PR #14549 Don't propagate ThrownException with components from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC