use alloc::string::String;
use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Error)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum NodeError {
#[error("Node label cannot be empty.")]
EmptyLabel,
#[error("Node ID cannot be empty.")]
EmptyId,
#[error("Node ID `{0}` contains invalid characters.")]
InvalidId(String),
#[error("Node `{0}` already exists.")]
DuplicateNode(String),
#[error("Node ID is missing.")]
MissingId,
#[error("Node label is missing.")]
MissingLabel,
#[error("Subnodes are missing.")]
MissingSubnodes,
}