use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("unsupported platform: os={os} arch={arch}")]
UnsupportedPlatform {
os: String,
arch: String,
},
#[error("unknown platform slug: {0}")]
UnknownPlatformSlug(String),
#[error("{context}: {source}")]
Io {
context: String,
#[source]
source: std::io::Error,
},
#[error("HTTP error: {0}")]
Http(#[source] reqwest::Error),
#[error("HTTP {status} when fetching {url}")]
HttpStatus {
url: String,
status: u16,
},
#[error("curl exited with code {code} when fetching {url}")]
CurlFailed {
url: String,
code: i32,
},
#[error("sha256 mismatch: expected {expected}, got {actual}")]
ChecksumMismatch {
expected: String,
actual: String,
},
#[error("failed to parse version TOML: {0}")]
TomlParse(#[source] toml::de::Error),
#[error("zip error: {0}")]
Zip(#[source] zip::result::ZipError),
#[error("hyperd executable not found in extracted archive")]
HyperdNotInArchive,
#[error("failed to scrape latest release: {0}")]
ScrapeFailed(&'static str),
}