1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum GraphError {
5 #[error("Task execution failed: {0}")]
6 TaskExecutionFailed(String),
7
8 #[error("Graph not found: {0}")]
9 GraphNotFound(String),
10
11 #[error("Invalid edge: {0}")]
12 InvalidEdge(String),
13
14 #[error("Task not found: {0}")]
15 TaskNotFound(String),
16
17 #[error("Context error: {0}")]
18 ContextError(String),
19
20 #[error("Storage error: {0}")]
21 StorageError(String),
22
23 #[error("Session not found: {0}")]
24 SessionNotFound(String),
25
26 #[error(transparent)]
27 Other(#[from] anyhow::Error),
28}
29
30pub type Result<T> = std::result::Result<T, GraphError>;