Skip to main content

project_map_cli_rust/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum AppError {
5    #[error("IO error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("JSON error: {0}")]
9    Json(#[from] serde_json::Error),
10
11    #[error("Parser error: {0}")]
12    Parser(String),
13
14    #[error("Index error: {0}")]
15    Index(String),
16
17    #[error("Generic error: {0}")]
18    Generic(String),
19}
20
21pub type Result<T> = std::result::Result<T, AppError>;