mermaid_builder/errors/
edge_error.rs1use alloc::string::String;
5
6use thiserror::Error;
7
8use crate::shared::ArrowShape;
9
10#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Error)]
11#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
12pub enum EdgeError {
14 #[error("Edge label cannot be empty.")]
16 EmptyLabel,
17 #[error("Incompatible left arrow shape: `{}`", .0.left())]
19 IncompatibleLeftArrowShape(ArrowShape),
20 #[error("Incompatible right arrow shape: `{}`", .0.right())]
22 IncompatibleRightArrowShape(ArrowShape),
23 #[error("Source node not found: `{0}`")]
25 SourceNodeNotFound(String),
26 #[error("Destination node not found: `{0}`")]
28 DestinationNodeNotFound(String),
29 #[error("Source node is missing.")]
31 MissingSource,
32 #[error("Destination node is missing.")]
34 MissingDestination,
35 #[error("Edge ID is missing.")]
37 MissingId,
38 #[error("Edge length must be greater than 0.")]
40 InvalidLength,
41}