mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-30 03:27:31 +00:00
Improve error messages for 'file not found' case (#550)
Right now, if you specify a wheel that doesn't exist, you get: `no such file or directory` with no additional context. Oops!
This commit is contained in:
parent
4e05cd5dfd
commit
5fddcc362e
11 changed files with 100 additions and 20 deletions
|
|
@ -5,7 +5,7 @@ use pubgrub::report::{DefaultStringReporter, Reporter};
|
|||
use thiserror::Error;
|
||||
use url::Url;
|
||||
|
||||
use distribution_types::{BuiltDist, SourceDist};
|
||||
use distribution_types::{BuiltDist, PathBuiltDist, PathSourceDist, SourceDist};
|
||||
use pep508_rs::Requirement;
|
||||
use puffin_distribution::DistributionDatabaseError;
|
||||
use puffin_normalize::PackageName;
|
||||
|
|
@ -54,11 +54,17 @@ pub enum ResolveError {
|
|||
#[error(transparent)]
|
||||
DistributionType(#[from] distribution_types::Error),
|
||||
|
||||
#[error("Failed to download {0}")]
|
||||
#[error("Failed to download: {0}")]
|
||||
Fetch(Box<BuiltDist>, #[source] DistributionDatabaseError),
|
||||
|
||||
#[error("Failed to download and build {0}")]
|
||||
#[error("Failed to download and build: {0}")]
|
||||
FetchAndBuild(Box<SourceDist>, #[source] DistributionDatabaseError),
|
||||
|
||||
#[error("Failed to read: {0}")]
|
||||
Read(Box<PathBuiltDist>, #[source] DistributionDatabaseError),
|
||||
|
||||
#[error("Failed to build: {0}")]
|
||||
Build(Box<PathSourceDist>, #[source] DistributionDatabaseError),
|
||||
}
|
||||
|
||||
impl<T> From<futures::channel::mpsc::TrySendError<T>> for ResolveError {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue