diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index ef3bbe49918f..bcfdd4bb5aed 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -125,12 +125,12 @@ pub(crate) async fn run( eprint!("{report:?}"); return Ok(ExitStatus::Failure); } - Err(ProjectError::Operation(operations::Error::Named(err))) => { - let err = miette::Report::msg(format!("{err}")).context("Invalid `--with` requirement"); - eprint!("{err:?}"); + Err(ProjectError::Anyhow(err)) => { + let report = miette::Report::msg(format!("{err}")); + eprint!("{report:?}"); return Ok(ExitStatus::Failure); } - Err(err) => return Err(err.into()), + Err(err) => return Err(err.into()) }; // TODO(zanieb): Determine the executable command via the package entry points diff --git a/crates/uv/tests/tool_run.rs b/crates/uv/tests/tool_run.rs index 16616434e7a1..913123fdeefa 100644 --- a/crates/uv/tests/tool_run.rs +++ b/crates/uv/tests/tool_run.rs @@ -942,11 +942,11 @@ fn tool_run_with_editable() -> anyhow::Result<()> { // If invalid, we should reference `--with`. uv_snapshot!(context.filters(), context.tool_run().arg("--with").arg("./foo").arg("flask").arg("--version"), @r###" success: false - exit_code: 2 + exit_code: 1 ----- stdout ----- ----- stderr ----- - error: Distribution not found at: file://[TEMP_DIR]/foo + × Distribution not found at: file://[TEMP_DIR]/foo "###); Ok(())