Skip to main content

waratah_router/
error.rs

1//! Typed errors for the routing layer.
2
3use crate::NodeId;
4
5/// Errors produced by pattern routing and table lookup.
6#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
7pub enum RouterError {
8    /// Pattern has no bound subject, predicate, or object.
9    #[error("pattern has no bound term to route on")]
10    UnboundPattern,
11
12    /// No nodes are registered for the selected partition axis.
13    #[error("no nodes registered for partition axis {0:?}")]
14    EmptyAxis(waratah_storage::PartitionAxis),
15
16    /// Routing table has no address for `node`.
17    #[error("unknown node in routing table: {0}")]
18    UnknownNode(NodeId),
19
20    /// Cluster config has no address for a hexastore axis.
21    #[error("cluster config has no address for partition axis {0}")]
22    MissingAxis(waratah_storage::PartitionAxis),
23
24    /// Cluster config has no address for the requested registry node.
25    #[error("unknown string-registry node: {0}")]
26    UnknownRegistryNode(crate::RegistryNodeId),
27
28    /// Cluster config declares no string-registry process.
29    #[error("cluster config declares no string-registry node")]
30    NoRegistryNodes,
31
32    /// Cluster config has no compute process with this id.
33    #[error("unknown compute node: {0}")]
34    UnknownCompute(String),
35
36    /// Two `[[computes]]` entries share an id.
37    #[error("duplicate compute id: {0}")]
38    DuplicateComputeId(String),
39
40    /// Cluster config could not be parsed.
41    #[error("invalid cluster config: {0}")]
42    Config(String),
43}