#[derive(Debug, thiserror::Error)] pub enum AppError { #[error("{0}")] Cli(String), #[error(transparent)] Fatal(#[from] anyhow::Error), } impl AppError { pub fn exit_code(&self) -> u8 { match self { Self::Cli(_) => 2, Self::Fatal(_) => 1, } } }