cnf_lib/error.rs
1// Copyright (C) 2023 Andreas Hartmann <hartan@7x.de>
2// GNU General Public License v3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5//! # CNF Error Types
6use thiserror::Error;
7
8pub mod prelude {
9 pub use super::CnfError;
10 pub use anyhow::{anyhow, Context};
11
12 /// Type alias for errors in this crate
13 pub type Result<T> = std::result::Result<T, CnfError>;
14}
15
16#[derive(Error, Debug)]
17pub enum CnfError {
18 /// Transparent error from any source
19 #[error(transparent)]
20 ApplicationError(#[from] anyhow::Error),
21
22 /// Required feature not implemented yet
23 #[error("please implement '{0}' first!")]
24 NotImplemented(String),
25}