1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum KanbanError {
5 #[error("Connection error: {0}")]
6 Connection(String),
7
8 #[error("Not found: {0}")]
9 NotFound(String),
10
11 #[error("Validation error: {0}")]
12 Validation(String),
13
14 #[error("IO error: {0}")]
15 Io(#[from] std::io::Error),
16
17 #[error("Serialization error: {0}")]
18 Serialization(String),
19
20 #[error("Internal error: {0}")]
21 Internal(String),
22
23 #[error("File conflict: {path} was modified by another instance")]
24 ConflictDetected {
25 path: String,
26 #[source]
27 source: Option<Box<dyn std::error::Error + Send + Sync>>,
28 },
29
30 #[error("Cycle detected: adding this edge would create a circular dependency")]
31 CycleDetected,
32
33 #[error("Self-reference not allowed")]
34 SelfReference,
35
36 #[error("Edge not found")]
37 EdgeNotFound,
38}