Skip to main content

loadsmith_core/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3    #[error("I/O error")]
4    Io(#[from] std::io::Error),
5
6    #[error("semver error")]
7    Semver(#[from] semver::Error),
8
9    #[error("URL parse error")]
10    Url(#[from] url::ParseError),
11
12    #[error("invalid package reference format")]
13    InvalidPackageRefFormat,
14
15    #[error("unknown checksum algorithm: {0}")]
16    UnknownAlgorithm(String),
17
18    #[error("invalid checksum format")]
19    InvalidChecksumFormat,
20
21    #[error("invalid blake3 hex value")]
22    InvalidBlake3Hex(#[source] blake3::HexError),
23
24    #[error("invalid sha256 hex value")]
25    InvalidSha256Hex(#[source] hex::FromHexError),
26}
27
28pub type Result<T> = std::result::Result<T, Error>;