Repository navigation
fix(gateway): say where and why the gateway panicked in the request's outcome - #332
Merged
Merged
Conversation
… outcome
When a request's stream panicked, the Ending dropped during unwinding could
only report `gw.internal` ("interrupted by an error inside the gateway"); the
panic message went to stderr, which nobody reads when the desktop app runs
core. twcore now installs a panic hook that notes the message and location on
the current thread (and logs them); the Ending dropped during that unwind
reports `gw.internal_panic` with them. Data that the standard library prints
into some panic messages (` of `...``, `value: ...`) is left out, and the
note is cut to 200 characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A request whose response stream panicked was recorded only as
gw.internal("The request was interrupted by an error inside the gateway."), with no hint of the cause: the panic message goes to stderr, which is not visible when the desktop app runs core.tw_gateway::panic_note: a panic hook (installed bytwcoreat start) that keeps the panic's message and location on the current thread, logs them, and calls the previous hook.Ending's drop during a panic reports the newgw.internal_panic(detail= message andfile:line:col); without a hook it falls back togw.internal.of `…`after a slicing error,value: …afterunwrap) is dropped, and the note is cut to 200 characters, so request content does not end up in the request log.New message code
gw.internal_panic(manifest regenerated). Tests:cargo test -p tw-gateway -p twcore, clippy, fmt.🤖 Generated with Claude Code