format {version} on failure (#15527)

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Fixes #15512 

## Test Plan

Manually tested :
```
~/uv/target/release/uv format --version 999.999.999 --preview-features format
error: Failed to install ruff 999.999.999
  Caused by: Failed to download from: https://github.com/astral-sh/ruff/releases/download/999.999.999/ruff-x86_64-unknown-linux-gnu.tar.gz
  Caused by: HTTP status client error (404 Not Found) for url (https://github.com/astral-sh/ruff/releases/download/999.999.999/ruff-x86_64-unknown-linux-gnu.tar.gz)
  ```
This commit is contained in:
Harsh Pratap Singh 2025-08-26 16:56:10 +05:30 committed by GitHub
parent 8c21baf9f1
commit 39537f4372
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ pub(crate) async fn format(
let version = version.as_ref().unwrap_or(&default_version);
let ruff_path = bin_install(Binary::Ruff, version, &client, &cache, &reporter)
.await
.context("Failed to install ruff {version}")?;
.with_context(|| format!("Failed to install ruff {version}"))?;
let mut command = Command::new(&ruff_path);
// Run ruff in the project root