Skip to content

Commit b6a3cd2

Browse files
committed
wip: catch anyhow
1 parent 6cb6fc2 commit b6a3cd2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/uv/src/commands/tool/run.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ pub(crate) async fn run(
125125
eprint!("{report:?}");
126126
return Ok(ExitStatus::Failure);
127127
}
128-
Err(ProjectError::Operation(operations::Error::Named(err))) => {
129-
let err = miette::Report::msg(format!("{err}")).context("Invalid `--with` requirement");
130-
eprint!("{err:?}");
128+
Err(ProjectError::Anyhow(err)) => {
129+
let report = miette::Report::msg(format!("{err}"));
130+
eprint!("{report:?}");
131131
return Ok(ExitStatus::Failure);
132132
}
133-
Err(err) => return Err(err.into()),
133+
Err(err) => return Err(err.into())
134134
};
135135

136136
// TODO(zanieb): Determine the executable command via the package entry points

crates/uv/tests/tool_run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,11 +942,11 @@ fn tool_run_with_editable() -> anyhow::Result<()> {
942942
// If invalid, we should reference `--with`.
943943
uv_snapshot!(context.filters(), context.tool_run().arg("--with").arg("./foo").arg("flask").arg("--version"), @r###"
944944
success: false
945-
exit_code: 2
945+
exit_code: 1
946946
----- stdout -----
947947
948948
----- stderr -----
949-
error: Distribution not found at: file://[TEMP_DIR]/foo
949+
× Distribution not found at: file://[TEMP_DIR]/foo
950950
"###);
951951

952952
Ok(())

0 commit comments

Comments
 (0)