intrepid_core/routing/
path_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// These errors can occur when trying to deserialize frame messages.
#[derive(Debug, thiserror::Error)]
pub enum PathError {
    /// Sometimes the frame isn't a message when we expect it to be.
    #[error("Frame is not a message")]
    FrameIsNotAMessage,
    /// Sometimes the path extraction is attempted with the wrong kind of system.
    #[error("Context is not a routing system")]
    IncorrectActionContext,
    /// Sometimes the path we've been given doesn't have any captures. This is an
    /// error because we can't proceed and attempt to deserialize if so.
    #[error("There were no captures for path: {0}")]
    FailedToCapture(String),
    /// Sometimes the path extraction fails to capture the given types. This can
    /// happen for a number of reasons, the most likely being that the type we've
    /// been given isn't a tuple and the consumer tried to extract a single type
    /// that wasn't friendly with the fact that we need to deserialize lists.
    #[error("Unable to capture given types from path: {0}")]
    DeserializationFailure(#[from] serde_json::Error),
}