1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;
use uuid::Uuid;

/// Ratio Graph errors.
#[derive(Clone, Debug, Error)]
pub enum GraphError {
    #[error("no node in store with this id: {0}")]
    NodeNotInStore(Uuid),
    #[error("node {0} is a bus node without a parent")]
    BusWithoutParent(Uuid),
    #[error("no node store provided")]
    MissingNodeStore,
    #[error("cyclic hierarchy detected, node {0} occurs in its own ascendants")]
    CyclicAscendants(Uuid),
    #[error("cyclic hierarchy detected, node {0} occurs in its own descendants")]
    CyclicDescendants(Uuid),
}