1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum BondError {
6 #[error("IO error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("SQLite error: {0}")]
12 Sqlite(#[from] rusqlite::Error),
13
14 #[error("Serialization error: {0}")]
16 Serde(#[from] serde_json::Error),
17
18 #[error("Bond already exists")]
20 AlreadyExists,
21
22 #[error("Target already exists: {0}")]
24 TargetExists(String),
25
26 #[error("Bond not found: {0}")]
28 NotFound(String),
29
30 #[error("Invalid path: {0}")]
32 InvalidPath(String),
33
34 #[error("config error: {0}")]
36 Config(String),
37
38 #[error("ambiguous identifier '{0}': use more characters")]
40 AmbiguousId(String),
41
42 #[error("invalid timestamp: {0}")]
44 InvalidTimestamp(String),
45}