//! Crate error type.
usecrate::routing::TaskClass;usethiserror::Error;/// Errors returned by the routing core.
////// The core is deliberately small: the only runtime failure it can produce is
/// a budget rejection from [`crate::CostTracker::record`].
#[derive(Debug, Clone, PartialEq, Error)]pubenumRouterError{/// A spend record was rejected because it would push total tracked cost
/// over the configured USD budget. The tracker is left unmodified.
#[error("budget exceeded: ${current:.4} recorded + ${attempted:.4} requested > ${limit:.2} limit")]
BudgetExceeded {/// Total spend already recorded, in USD.
current:f64,/// Cost of the rejected record, in USD.
attempted:f64,/// The configured budget limit, in USD.
limit:f64,},/// No rule and no default model can satisfy a routing request.
#[error("no route available for task class `{task}` and no default model configured")]
NoRoute {/// The task class that could not be routed.
task: TaskClass,},}