mermaid_builder/errors/
node_error.rs1use alloc::string::String;
5
6use thiserror::Error;
7
8#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Error)]
9#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
10pub enum NodeError {
12 #[error("Node label cannot be empty.")]
14 EmptyLabel,
15 #[error("Node ID cannot be empty.")]
17 EmptyId,
18 #[error("Node ID `{0}` contains invalid characters.")]
20 InvalidId(String),
21 #[error("Node `{0}` already exists.")]
23 DuplicateNode(String),
24 #[error("Node ID is missing.")]
26 MissingId,
27 #[error("Node label is missing.")]
29 MissingLabel,
30 #[error("Subnodes are missing.")]
32 MissingSubnodes,
33}