cnf-lib 0.6.0

Distribution-agnostic 'command not found'-handler
Documentation
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: (C) 2023 Andreas Hartmann <hartan@7x.de>
// This file is part of cnf-lib, available at <https://gitlab.com/hartang/rust/cnf>

//! # CNF Error Types
use thiserror::Error;

/// Useful functions and bits for error handling.
pub mod prelude {
    pub use super::CnfError;
    pub use anyhow::{Context, anyhow};

    /// Type alias for errors in this crate
    pub type Result<T> = std::result::Result<T, CnfError>;
}

/// Public error type for `cnf`.
#[derive(Error, Debug)]
pub enum CnfError {
    /// Transparent error from any source
    #[error(transparent)]
    ApplicationError(#[from] anyhow::Error),

    /// Required feature not implemented yet
    #[error("please implement '{0}' first!")]
    NotImplemented(String),
}