Skip to content

Commit

Permalink
Use display representation for download error
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jul 18, 2024
1 parent 91bf213 commit 09bad6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions crates/uv-python/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub enum Error {
IO(#[from] io::Error),
#[error(transparent)]
ImplementationError(#[from] ImplementationError),
#[error("Invalid python version: {0}")]
#[error("Invalid Python version: {0}")]
InvalidPythonVersion(String),
#[error("Invalid request key, too many parts: {0}")]
#[error("Invalid request key (too many parts): {0}")]
TooManyParts(String),
#[error("Download failed")]
NetworkError(#[from] WrappedReqwestError),
Expand All @@ -48,7 +48,7 @@ pub enum Error {
expected: String,
actual: String,
},
#[error("Invalid download url")]
#[error("Invalid download URL")]
InvalidUrl(#[from] url::ParseError),
#[error("Failed to create download directory")]
DownloadDirError(#[source] io::Error),
Expand All @@ -68,8 +68,7 @@ pub enum Error {
NameError(String),
#[error("Failed to parse request part")]
InvalidRequestPlatform(#[from] platform::Error),
// TODO(zanieb): Implement display for `PythonDownloadRequest`
#[error("No download found for request: {0:?}")]
#[error("No download found for request: {0}")]
NoDownloadFound(PythonDownloadRequest),
}

Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/python/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(crate) async fn install(
.find(|installation| download_request.satisfied_by_key(installation.key()))
{
if matches!(request, PythonRequest::Any) {
writeln!(printer.stderr(), "Found: {}", installation.key().green(),)?;
writeln!(printer.stderr(), "Found: {}", installation.key().green())?;
} else {
writeln!(
printer.stderr(),
Expand Down

0 comments on commit 09bad6a

Please sign in to comment.