~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/vuln-notif

0
0
main
16 lines · 310 B Raw History
#[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,
        }
    }
}