Skip to main content

deke_multipath/
error.rs

1use deke_types::DekeError;
2
3/// Failure modes specific to multipath solving, layered over [`DekeError`] for
4/// the underlying planning / validation / path-construction failures that flow
5/// up from the deke primitives.
6#[derive(Debug, Clone, thiserror::Error)]
7pub enum MultipathError {
8    /// A required path was declared with zero options to choose from (an empty
9    /// `ManyWays`), making the tour infeasible — there is nothing to traverse
10    /// for that cluster.
11    #[error("required path #{0} has no options")]
12    EmptyOptions(usize),
13
14    /// The solver could not find any ordering that visits every required path,
15    /// e.g. because a supplied cost function reported every relevant transition
16    /// as non-finite.
17    #[error("no feasible ordering exists through the required paths")]
18    NoFeasibleTour,
19
20    /// An underlying deke operation failed: planning a connector, validating a
21    /// straight-line connector, or constructing a path.
22    #[error(transparent)]
23    Deke(#[from] DekeError),
24}
25
26pub type MultipathResult<T> = Result<T, MultipathError>;