use thiserror::Error;
#[derive(Error, Debug)]
pub enum MhoError {
#[error("Configuration error: {0}")]
Config(String),
#[error("Process error: {0}")]
Process(String),
#[error("Download error: {0}")]
Download(String),
#[error("Platform error: {0}")]
Platform(String),
#[error("Logging error: {0}")]
Log(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("Parse error: {0}")]
ParseInt(#[from] std::num::ParseIntError),
#[error("UTF-8 error: {0}")]
Utf8(#[from] std::string::FromUtf8Error),
#[error("External error: {0}")]
External(String),
}
pub type Result<T> = std::result::Result<T, MhoError>;