Repository navigation
Route final errors through the printer - #20114
Closed
charliermarsh wants to merge 3 commits into
Closed
charliermarsh wants to merge 3 commits into
charliermarsh wants to merge 3 commits into
Conversation
charliermarsh
marked this pull request as ready for review
July 4, 2026 15:27
charliermarsh
marked this pull request as draft
July 4, 2026 15:28
charliermarsh
marked this pull request as ready for review
July 4, 2026 15:37
uv test inventory changesThis PR changes the tests when compared with the latest
|
zsol
self-requested a review
July 6, 2026 14:49
Member
|
This has some interactions with the miette removal work, I'll see if they're problematic. |
This was referenced Jul 6, 2026
zanieb
reviewed
Jul 7, 2026
Comment on lines
-206
to
-215
| impl From<ExitStatus> for ExitCode { | ||
| fn from(status: ExitStatus) -> Self { | ||
| match status { | ||
| ExitStatus::Success => Self::from(0), | ||
| ExitStatus::Failure => Self::from(1), | ||
| ExitStatus::Error => Self::from(2), | ||
| ExitStatus::External(code) => Self::from(code), | ||
| } | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
zanieb
reviewed
Jul 7, 2026
| .expect("writing to stderr should not fail"); | ||
|
|
||
| ExitStatus::Error.into() | ||
| ExitCode::from(2) |
Member
There was a problem hiding this comment.
I am a bit sad we can't reuse our constant definition here
zsol
approved these changes
Jul 7, 2026
zsol
left a comment
Member
There was a problem hiding this comment.
lgtm, but no idea about the miette interactions so you might want to wait for Zanie before merging
Closed
zanieb
added a commit
that referenced
this pull request
Jul 7, 2026
Keep `ExitStatus` code-only and represent propagated command errors explicitly as `UvError::User` or `UvError::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-carrying `ExitStatus` introduced in #20114. The stacked follow-up #20163 routes this centralized rendering through `Printer` and defines the resulting `-q` and `-qq` behavior. Part of #17110.
Member
|
I'm going to go with my approach instead, though time may tell that it's not any better :) |
Member
Author
|
Sounds great, thank you! |
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.
Summary
Final command errors currently take two paths: returned
anyhow::Errorvalues are rendered by the top-level entry point, while expected validation failures print directly and return a bareExitStatus. The top-level renderer bypassesPrinter, so-qqstill emits errors, while lockfile mismatch messages use ordinary stderr and disappear under-q.This separates the process exit code from an optional final error in
ExitStatusand renders final errors throughstderr_important(). Lockfile mismatch paths now return their error instead of printing it, so final diagnostics remain visible under-q, are suppressed under-qq, and retain their existing exit codes: 1 for expected lock mismatches and 2 for unexpected command errors.Closes #19326.