rmp_route_optimizer/
error.rs1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, OptimizationError>;
7
8#[derive(Debug, Error)]
10pub enum OptimizationError {
11 #[error("Graph must contain at least one node")]
13 EmptyGraph,
14
15 #[error("Graph must contain at least one edge")]
17 NoEdges,
18
19 #[error("Start node {0} not found in graph")]
21 StartNodeNotFound(i64),
22
23 #[error("Graph is not connected - cannot create Eulerian circuit")]
25 DisconnectedGraph,
26
27 #[error("Invalid edge: {0}")]
29 InvalidEdge(String),
30
31 #[error("Graph has {0} odd-degree vertices (maximum supported: 100)")]
33 TooManyOddVertices(usize),
34
35 #[error("Failed to make graph Eulerian: {0}")]
37 AugmentationFailed(String),
38
39 #[error("Failed to construct Eulerian circuit: {0}")]
41 CircuitConstructionFailed(String),
42}