use std::{
num::ParseIntError,
process::{ExitCode, Termination},
};
#[derive(thiserror::Error, Debug, Clone)]
pub enum AppError {
#[error("Invalid path")]
InvalidPath,
}
impl Termination for AppError {
fn report(self) -> ExitCode {
match self {
AppError::InvalidPath => ExitCode::from(1),
}
}
}
#[derive(thiserror::Error, Debug, Clone)]
pub enum ArgError {
#[error("Invalid format in interval")]
IntervalInvalidFormat,
#[error("Invalid integer coordinates in interval")]
IntervalInvalidInts(#[from] ParseIntError),
}