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