p2panda_rs/graph/
error.rs1use thiserror::Error;
5
6#[derive(Error, Debug, Clone)]
8#[allow(missing_copy_implementations)]
9pub enum GraphError {
10 #[error("Cycle detected")]
12 CycleDetected,
13
14 #[error("Badly formed graph")]
16 BadlyFormedGraph,
17
18 #[error("No root node found")]
20 NoRootNode,
21
22 #[error("Multiple root nodes found")]
24 MultipleRootNodes,
25
26 #[error("Node not found in graph")]
28 NodeNotFound,
29
30 #[error("Requested trim nodes not found in graph")]
32 InvalidTrimNodes,
33
34 #[error(transparent)]
36 ReducerError(#[from] ReducerError),
37}
38
39#[derive(Error, Debug, Clone)]
41#[allow(missing_copy_implementations)]
42pub enum ReducerError {
43 #[error("Could not perform reducer function: {0}")]
45 Custom(String),
46}