uv_distribution_types/
error.rs

1use uv_normalize::PackageName;
2use uv_redacted::DisplaySafeUrl;
3
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6    #[error(transparent)]
7    Io(#[from] std::io::Error),
8
9    #[error(transparent)]
10    Utf8(#[from] std::str::Utf8Error),
11
12    #[error(transparent)]
13    WheelFilename(#[from] uv_distribution_filename::WheelFilenameError),
14
15    #[error("Could not extract path segments from URL: {0}")]
16    MissingPathSegments(String),
17
18    #[error("Distribution not found at: {0}")]
19    NotFound(DisplaySafeUrl),
20
21    #[error("Requested package name `{0}` does not match `{1}` in the distribution filename: {2}")]
22    PackageNameMismatch(PackageName, PackageName, String),
23}