2025-04-27 08:36:57 +09:00
|
|
|
#[derive(thiserror::Error, Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
#[error("Parser error")]
|
|
|
|
Clap(#[from] clap::Error),
|
|
|
|
#[error("Parse int error")]
|
|
|
|
ParseIntError(#[from] std::num::ParseIntError),
|
|
|
|
#[error("IO Error")]
|
|
|
|
IoError(#[from] std::io::Error),
|
2025-05-02 08:57:43 +09:00
|
|
|
#[error("Parse toml error")]
|
|
|
|
TomlDe(#[from] toml::de::Error),
|
2025-04-27 08:36:57 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Error {
|
|
|
|
pub fn print(&self) -> Result<(), Error> {
|
|
|
|
match self {
|
|
|
|
Error::Clap(x) => Ok(x.print()?),
|
|
|
|
_ => unimplemented!(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|