GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Route final errors through the printer by charliermarsh · Pull Request #20114 · astral-sh/uv

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Jul 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Final command errors currently take two paths: returned anyhow::Error values are rendered by the top-level entry point, while expected validation failures print directly and return a bare ExitStatus. The top-level renderer bypasses Printer, so -qq still 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 ExitStatus and renders final errors through stderr_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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@charliermarsh
Route final errors through the printer
89b51ef
@charliermarsh charliermarsh added area:error-messages Messaging when something goes wrong breaking A breaking change labels Jul 4, 2026
@charliermarsh charliermarsh added this to the v0.12.0 milestone Jul 4, 2026
@charliermarsh
charliermarsh marked this pull request as ready for review July 4, 2026 15:27
@charliermarsh
charliermarsh marked this pull request as draft July 4, 2026 15:28
@charliermarsh
Simplify exit status representation
02979c4
@charliermarsh
charliermarsh marked this pull request as ready for review July 4, 2026 15:37
@charliermarsh
Rename exit error constructor
094ca8f
@astral-sh-bot

astral-sh-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the latest charlie/operation-diagnostic-printer baseline.

  • Added tests: 2
  • Removed tests: 0
  • Changed suites: 2
uv::lock: +1 / -0

Added:

  • uv::lock::lock::locked_quiet_modes

Removed: none

uv::workspace: +1 / -0

Added:

  • uv::workspace::workspace_metadata::workspace_metadata_locked_quiet_modes

Removed: none

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zsol
zsol self-requested a review July 6, 2026 14:49
@zanieb

zanieb commented Jul 6, 2026

Copy link
Copy Markdown
Member

This has some interactions with the miette removal work, I'll see if they're problematic.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 6, 2026
Use standard rendering for tool requirement errors #20160
Merged
Route final command errors through the printer to respect -q and -qq #20163
Merged
zanieb
zanieb reviewed Jul 7, 2026
View reviewed changes
Comment thread crates/uv/src/commands/mod.rs
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),
}
}
}

@zanieb zanieb Jul 7, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this go away?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zanieb zanieb Jul 7, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, we use into_parts https://github.com/astral-sh/uv/pull/20114/changes#diff-acdeb22c41066388ed84386bbe38879a7fab52da88324df633029e4f52e427b9R3018

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zanieb
zanieb reviewed Jul 7, 2026
View reviewed changes
Comment thread crates/uv/src/lib.rs
.expect("writing to stderr should not fail");

ExitStatus::Error.into()
ExitCode::from(2)

@zanieb zanieb Jul 7, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit sad we can't reuse our constant definition here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zsol
zsol approved these changes Jul 7, 2026
View reviewed changes

@zsol zsol left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but no idea about the miette interactions so you might want to wait for Zanie before merging

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@konstin konstin mentioned this pull request Jul 7, 2026
CI test #20003
Closed
@zanieb zanieb mentioned this pull request Jul 7, 2026
Model final command errors explicitly #20188
Merged
zanieb added a commit that referenced this pull request Jul 7, 2026
@zanieb
Model final command errors explicitly (#20188)
da1613b
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.
@zanieb

zanieb commented Jul 7, 2026

Copy link
Copy Markdown
Member

I'm going to go with my approach instead, though time may tell that it's not any better :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zanieb zanieb closed this Jul 7, 2026
@charliermarsh

charliermarsh commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Sounds great, thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zanieb zanieb zanieb left review comments
@zsol zsol zsol approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area:error-messages Messaging when something goes wrong breaking A breaking change

Projects

None yet

Milestone

v0.12.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@charliermarsh @zanieb @zsol
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.