1use thiserror::Error;
10
11pub type Result<T> = std::result::Result<T, Error>;
12
13#[derive(Debug, Error)]
14#[allow(missing_docs)]
15pub enum Error {
16 #[error("Cannot parse file name from the URL")]
17 CannotParseFilenameFromUrl,
18 #[error("Unexpected response from crates.io: {0}")]
19 CratesIoResponseError(u16),
20 #[error(transparent)]
21 DateTimeParseError(#[from] chrono::ParseError),
22 #[error("Could not convert API response header links to string")]
23 HeaderLinksToStrError,
24 #[error(transparent)]
25 Io(#[from] std::io::Error),
26 #[error(transparent)]
27 JsonError(#[from] serde_json::Error),
28 #[error("Latest release not found for {0}")]
29 LatestReleaseNotFound(String),
30 #[error("{0}")]
31 PlatformNotSupported(String),
32 #[error("Could not compile the regex statement")]
33 RegexError,
34 #[error(transparent)]
35 ReqwestError(#[from] reqwest::Error),
36 #[error("Release binary {0} was not found")]
37 ReleaseBinaryNotFound(String),
38 #[error(transparent)]
39 SemVerError(#[from] semver::Error),
40 #[error("Could not parse version from tag name")]
41 TagNameVersionParsingFailed,
42 #[error("The URL must point to a zip or gzipped tar archive")]
43 UrlIsNotArchive,
44 #[error("Unknown platform: {0}")]
45 UnknownPlatform(String),
46 #[error(transparent)]
47 ZipError(#[from] zip::result::ZipError),
48}