use alloc::string::String;
use thiserror::Error;
use crate::shared::ArrowShape;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Error)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum EdgeError {
#[error("Edge label cannot be empty.")]
EmptyLabel,
#[error("Incompatible left arrow shape: `{}`", .0.left())]
IncompatibleLeftArrowShape(ArrowShape),
#[error("Incompatible right arrow shape: `{}`", .0.right())]
IncompatibleRightArrowShape(ArrowShape),
#[error("Source node not found: `{0}`")]
SourceNodeNotFound(String),
#[error("Destination node not found: `{0}`")]
DestinationNodeNotFound(String),
#[error("Source node is missing.")]
MissingSource,
#[error("Destination node is missing.")]
MissingDestination,
#[error("Edge ID is missing.")]
MissingId,
#[error("Edge length must be greater than 0.")]
InvalidLength,
}