The diagnostic is the first line again - #426
Merged
Merged
Conversation
An earlier fix moved parse and lexer failures out of the
`Error: execution failed` / `Caused by:` wrapper so their diagnostic
leads. It stopped there, and `error_presentation_tests.rs` pinned the
remaining classes to record that boundary rather than to endorse it.
Everything else that fails during execution was still buried. A
validation failure produces the same `line:col [code]: message` shape a
parse error does, and it was arriving three lines down:
Error: execution failed
<blank>
Caused by:
validation failed:
error [E012]: bare variable in for loop iterates once …
→ wrap it in $(...) …
The suggested rewrite — the part that tells the reader what to do — was
the fifth line of output. Assume the context is truncated and the whole
message is gone.
`execution failed` named the phase and nothing else, and as the
outermost context anyhow makes it the headline. Removed. The kernel's
own diagnostic leads, and callers print it directly rather than letting
`main` re-wrap it with an `Error:` prefix and a `Caused by:` split, the
same way the parse path already prints.
The boundary that remains is between a GENERIC context and a SPECIFIC
one. `Failed to read script: <path>` names the file and the action,
which the io error under it does not, so it stays and is still pinned.
The rule is not "no context", it is "no context that displaces the
message with less information than the message".
Two pins became assertions about the effect instead of the mechanism.
Untouched and still passing: parse, lexer, command-not-found, a
nonzero exit, and a builtin's own error, none of which went through the
wrapper.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…n-wrapper # Conflicts: # CHANGELOG.md
…n-wrapper # Conflicts: # CHANGELOG.md
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Independent of #421-#425 — this one is off main and touches only the REPL binary and its presentation tests.
An earlier fix moved parse and lexer failures out of the
Error: execution failed/Caused by:wrapper so their diagnostic leads. It stopped there, anderror_presentation_tests.rspinned the remaining classes to record that boundary rather than to endorse it.Everything else that fails during execution was still buried. A validation failure produces the same
line:col [code]: messageshape a parse error does, and it arrived three lines down:The suggested rewrite — the part that tells the reader what to do — was the fifth line of output. Assume the context is truncated and the whole message is gone. It now reads:
execution failednamed the phase and nothing else, and as the outermost context anyhow makes it the headline. Removed. Callers print the diagnostic directly rather than lettingmainre-wrap it with anError:prefix and aCaused by:split, the same way the parse path already prints.The boundary that remains is between a generic context and a specific one.
Failed to read script: <path>names the file and the action, which the io error under it does not, so it stays and is still pinned. The rule is not "no context", it is "no context that displaces the message with less information than the message".Untouched and still passing: parse, lexer, command-not-found, a nonzero exit, and a builtin's own error, none of which went through the wrapper. Exit codes are unchanged.
Gates: test --all, clippy (0 warnings), rustdoc, no-default-features, wasi, and insta all green.