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("external tool failed: {0}")]
21 Tool(String),
22
23 #[error("invalid glob: {0}")]
24 Glob(String),
25
26 #[error("invalid configuration: {0}")]
27 Config(String),
28
29 #[error("not yet implemented: {0}")]
30 NotImplemented(&'static str),
31}
32
33pub type Result<T> = std::result::Result<T, Error>;