#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("http error: {0}")]
Http(#[from] reqwest::Error),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
#[error("zip error: {0}")]
Zip(#[from] zip::result::ZipError),
#[error("unsupported platform: {0}")]
UnsupportedPlatform(String),
#[error("unsupported archive format: {0}")]
UnsupportedArchive(String),
#[error("no GitHub token found: set GH_TOKEN or GITHUB_TOKEN, or run `gh auth login`")]
MissingToken,
#[error("github api error: {0}")]
Api(String),
#[error("configuration error: {0}")]
Config(String),
#[error("operation cancelled")]
Cancelled,
#[error("checksum mismatch: {0}")]
Checksum(String),
#[error("command failed: {0}")]
Command(String),
#[error("`{0}` is not implemented yet")]
Unimplemented(String),
}
pub type Result<T, E = Error> = std::result::Result<T, E>;