Model final command errors explicitly - #20188
Merged
Merged
Conversation
zanieb
force-pushed
the
zb/explicit-user-failures
branch
from
July 7, 2026 15:09
d625418 to
34ea105
Compare
zanieb
force-pushed
the
zb/explicit-user-failures
branch
from
July 7, 2026 15:26
34ea105 to
3789bd8
Compare
zanieb
commented
Jul 7, 2026
zanieb
force-pushed
the
zb/explicit-user-failures
branch
2 times, most recently
from
July 7, 2026 15:43
bf5c297 to
63f741c
Compare
uv test inventory changesThis PR changes the tests when compared with the latest
|
zanieb
marked this pull request as ready for review
July 7, 2026 17:10
zanieb
force-pushed
the
zb/explicit-user-failures
branch
from
July 7, 2026 17:42
4320d74 to
c3b9f91
Compare
zanieb
added a commit
that referenced
this pull request
Jul 7, 2026
Render final `UvError` values through `Printer` at the command entrypoint. The default error-chain renderer accepts the `Printer` directly and owns hint collection and stream selection; `-q` preserves final errors and `-qq` suppresses them while exit codes remain 1 for user errors and 2 for unexpected errors. Stacked on #20188. Part of #17110. Closes #19326.
zanieb
added a commit
that referenced
this pull request
Jul 7, 2026
Our trace log that emits a debug representation of errors is useless for `anyhow::Error` which is more common following #20188. For `UvError::User`, we elide the trace log entirely, I do not expect us to need to debug those error chains. For `UvError::Unexpected`, we introduce a new `uv_errors::debug_error_chain` formatter that walks each source and renders its `Debug` representation. To retain parity with the previous implementation, we also log the backtrace if available. e.g.: ```diff -TRACE Error trace: Failed to create virtual environment - -Caused by: - Not a directory (os error 20) +TRACE Error chain: +0: Creation(Io(Os { code: 20, kind: NotADirectory, message: "Not a directory" })) +1: Io(Os { code: 20, kind: NotADirectory, message: "Not a directory" }) error: Failed to create virtual environment Caused by: Not a directory (os error 20) ```
Draft
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.
Keep
ExitStatuscode-only and represent propagated command errors explicitly asUvError::UserorUvError::Unexpected. Command handlers classify and propagate their errors; the entrypoint renders user errors as a single line with exit code 1 and renders unclassified error chains with exit code 2. This preserves the existing default text and exit codes while providing a behavior-focused alternative to the error-carryingExitStatusintroduced in #20114.The stacked follow-up #20163 routes this centralized rendering through
Printerand defines the resulting-qand-qqbehavior.Part of #17110.