Skip to content

fix(runtime-sdk): chain the app's exception onto a reported lifespan failure - #237

Open
whitphx wants to merge 1 commit into
cloudflare:mainfrom
whitphx:fix/asgi-lifespan-chain-cause
Open

fix(runtime-sdk): chain the app's exception onto a reported lifespan failure#237
whitphx wants to merge 1 commit into
cloudflare:mainfrom
whitphx:fix/asgi-lifespan-chain-cause

Conversation

@whitphx

@whitphx whitphx commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

When an app reports lifespan.startup.failed, the caller gets a RuntimeError carrying only the message text, so the app's own exception object reaches nobody. This attaches it as the reported error's __cause__, on the startup and shutdown paths alike.

Test Plan

$ uv run pytest 'tests/test_in_workerd.py::test_in_workerd[asgi-3.13]' -v

(run from packages/runtime-sdk)

@whitphx
whitphx marked this pull request as draft August 29, 2026 12:49
…failure

A reported startup or shutdown failure surfaced as a bare RuntimeError
carrying only the message text, so the app's own exception reached
callers nowhere. Frameworks re-raise it right after sending the failed
event, and in that same-tick case the awaiter has not resumed, so
attaching it there delivers it as the reported error's cause.
@whitphx
whitphx force-pushed the fix/asgi-lifespan-chain-cause branch from 1d73c14 to f7783dd Compare August 30, 2026 02:56
@whitphx
whitphx marked this pull request as ready for review August 30, 2026 05:15
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.

1 participant