Repository navigation
Separate operation context from exit-status classification - #21587
Merged
Merged
Conversation
zanieb
added this pull request to stack #21585
September 10, 2026 15:34
zanieb
removed this pull request from stack #21585
September 10, 2026 15:42
zanieb
added this pull request to stack #21588
September 10, 2026 15:43
zanieb
force-pushed
the
zb/operation-error-context
branch
from
September 10, 2026 20:11
3b24857 to
99fb143
Compare
charliermarsh
approved these changes
Sep 10, 2026
zanieb
force-pushed
the
zb/operation-error-context
branch
from
September 10, 2026 21:51
99fb143 to
05716e9
Compare
zanieb
had a problem deploying
to
automations
September 10, 2026 21:52 — with
GitHub Actions
Failure
zanieb
marked this pull request as ready for review
September 10, 2026 21:53
zanieb
force-pushed
the
zb/operation-error-context
branch
from
September 10, 2026 22:18
05716e9 to
ed7b664
Compare
zanieb
had a problem deploying
to
automations
September 10, 2026 22:19 — with
GitHub Actions
Failure
zanieb
force-pushed
the
zb/operation-error-context
branch
from
September 11, 2026 18:12
ed7b664 to
d12e43b
Compare
zanieb
added a commit
that referenced
this pull request
Sep 11, 2026
Route the remaining package-operation errors through `UvError` and the standard error-chain renderer, then remove uv's direct `miette` dependency and global hook. Diagnostics use the same source-chain formatting and hint collection as other commands, with cause-specific hints before general command advice. No-solution headings omit trailing punctuation, retain their command context, and are not repeated inside build-dependency errors. Final errors remain visible with `-q` and are suppressed with `-qq`. Classify operation failures by their underlying cause instead of by which renderer handles them. Each error type owns its classification, and type-erased build errors forward it. Expected package, resolution, build, integrity, and lock-validation failures use code 1, while recognized transport, cache, filesystem, and internal failures use code 2. This deliberately changes some previously inconsistent statuses without attempting to normalize every standalone command or opaque archive-error path. Command-line argument errors remain code 2. Third-party dependencies may still use `miette` internally. Prior work: - #14546 removed `miette` from `uv venv`. - #17535 added first-party line wrapping. - #18090 established the `Hint` and `Hints` APIs. - #20155 made hints explicit in error-chain rendering. - #20156 preserved indentation in multiline causes. - #20159 migrated `uv build` errors to standard rendering. - #20160 migrated tool requirement errors to standard rendering. - #20188 introduced the explicit `UvError` model. - #20163 routed final errors through `Printer` for `-q` and `-qq`. - #20217 enabled cause-chain rendering for user errors. - #21563 added verification of index-provided metadata hashes. - #21279 reused URL-provided hashes during resolution. - #21584 renamed the hint-producing trait to `Hinted`. - #21577 added explicit hint ordering. Follow-up work: - #21566 collects hints for batched `uv tool upgrade` failures and fixes their quiet-mode output. - #21568 routes Python upgrade request errors and version-file hints through `UvError`. - #21587 separates operation-specific diagnostic context from exit-status classification. - #21599 renders error and warning causes with compact tree connectors.
zanieb
added a commit
that referenced
this pull request
Sep 11, 2026
Render error and warning source chains with compact `├──` and `└──` tree connectors instead of repeating `Caused by:`. The shared formatter retains the `error:` and `warning:` labels, aligns wrapped and authored multiline causes beneath their text, and includes the gutter in the terminal-width calculation. Hint placement and exit-status classification are unchanged. ```text error: Failed to download and build `demo-pkg @ http://[LOCALHOST]/files/demo_pkg-1.0.0.tar.gz` ├── Failed to extract archive: demo-pkg @ http://[LOCALHOST]/files/demo_pkg-1.0.0.tar.gz ├── I/O operation failed during extraction └── Invalid gzip header ``` Prior work: - #17110 routes the remaining package-operation errors through the shared formatter. - #21587 separates operation-specific diagnostic context from exit-status classification.
zanieb
added a commit
that referenced
this pull request
Sep 11, 2026
Render each source error with a compact `cause:` label, keeping the existing `error:` and `warning:` headings. Wrapped and authored continuation lines align beneath the cause text, and hints remain separate from the error chain. This changes presentation only; source ordering and exit statuses are unchanged. Prior work: - #17110 removes the direct `miette` dependency and routes command failures through the shared renderer. - #21587 separates operation context from exit-status classification. - #21599 introduces compact tree connectors for source chains.
This branch was successfully deployed
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.
Resolution headings are assembled inside
UvError::from_operation, mixing operation-specific formatting with exit-status selection. Store no-solution and contextual-requirement headings as typedoperations::Errorvariants, and attach command context before converting toUvError. Add the default no-solution heading only at the final command-error boundary so errors nested under higher-level build or tool messages do not gain redundant headings. The original sources and hints remain available, and diagnostic output and exit-status policy are unchanged.Prior work:
UvErrormodel.