cargo_context_core/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5 #[error("i/o error: {0}")]
6 Io(#[from] std::io::Error),
7
8 #[error("regex compile error: {0}")]
9 Regex(#[from] regex::Error),
10
11 #[error("yaml error: {0}")]
12 Yaml(#[from] serde_yaml::Error),
13
14 #[error("json error: {0}")]
15 Json(#[from] serde_json::Error),
16
17 #[error("budget exceeded: {actual} tokens > {limit}")]
18 BudgetExceeded { actual: usize, limit: usize },
19
20 #[error("invalid configuration: {0}")]
21 Config(String),
22
23 #[error("not yet implemented: {0}")]
24 NotImplemented(&'static str),
25}
26
27pub type Result<T> = std::result::Result<T, Error>;