1use crate::node::NodeId;
2
3#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
4pub enum GraphError {
5 #[error("duplicate node id `{0}` (ids are case-sensitive; collision is an error, not a merge)")]
6 DuplicateNode(NodeId),
7 #[error("edge endpoint `{0}` does not exist in the graph")]
8 MissingEndpoint(NodeId),
9 #[error("node `{id}` has an empty {field}")]
10 EmptyField { id: NodeId, field: &'static str },
11 #[error("node `{id}` has an invalid span {start}..{end}")]
12 InvalidSpan { id: NodeId, start: u64, end: u64 },
13}