Skip to content

Commit

Permalink
wip: catch anyhow
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto7250 committed Sep 2, 2024
1 parent 6cb6fc2 commit b6a3cd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/uv/src/commands/tool/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/tool_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit b6a3cd2

Please sign in to comment.