jellyflow_core/ops/mutation/
error.rs1use crate::core::{BindingId, EdgeId, GroupId, NodeId, PortId, StickyNoteId};
2
3#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
4pub enum GraphMutationError {
5 #[error("node already exists: {0:?}")]
6 NodeAlreadyExists(NodeId),
7 #[error("missing node: {0:?}")]
8 MissingNode(NodeId),
9 #[error("port already exists: {0:?}")]
10 PortAlreadyExists(PortId),
11 #[error("missing port: {0:?}")]
12 MissingPort(PortId),
13 #[error("edge already exists: {0:?}")]
14 EdgeAlreadyExists(EdgeId),
15 #[error("missing edge: {0:?}")]
16 MissingEdge(EdgeId),
17 #[error("missing group: {0:?}")]
18 MissingGroup(GroupId),
19 #[error("binding already exists: {0:?}")]
20 BindingAlreadyExists(BindingId),
21 #[error("missing binding: {0:?}")]
22 MissingBinding(BindingId),
23 #[error("missing sticky note: {0:?}")]
24 MissingStickyNote(StickyNoteId),
25 #[error("port owner mismatch: port={port:?} expected={expected:?} got={got:?}")]
26 PortOwnerMismatch {
27 port: PortId,
28 expected: NodeId,
29 got: NodeId,
30 },
31 #[error("duplicate port in node planning: node={node:?} port={port:?}")]
32 DuplicateNodePort { node: NodeId, port: PortId },
33 #[error("port insert index out of bounds: node={node:?} index={index} len={len}")]
34 PortInsertOutOfBounds {
35 node: NodeId,
36 index: usize,
37 len: usize,
38 },
39}