Skip to main content

routee_compass/app/map_matching/
map_matching_app_error.rs

1use routee_compass_core::algorithm::map_matching::MapMatchingError;
2use thiserror::Error;
3
4/// Error types for the map matching application layer.
5#[derive(Error, Debug)]
6pub enum MapMatchingAppError {
7    #[error("failed to build map matching app: {0}")]
8    BuildFailure(String),
9
10    #[error("map matching algorithm error: {source}")]
11    AlgorithmError {
12        #[from]
13        source: MapMatchingError,
14    },
15
16    #[error("invalid request: {0}")]
17    InvalidRequest(String),
18
19    #[error("JSON error: {source}")]
20    JsonError {
21        #[from]
22        source: serde_json::Error,
23    },
24}