Skip to main content

waymark_tilecache/
error.rs

1//! Error types for the waymark-tilecache crate
2
3/// Error from tile cache operations
4#[derive(thiserror::Error, Debug)]
5pub enum TileCacheError {
6    #[error("invalid parameter")]
7    InvalidParam,
8
9    #[error("out of memory: {resource}")]
10    OutOfMemory { resource: &'static str },
11
12    #[error("tile not found: ({x}, {y})")]
13    TileNotFound { x: i32, y: i32 },
14
15    #[error("obstacle not found")]
16    ObstacleNotFound,
17
18    #[error("invalid region data size")]
19    InvalidRegionData,
20
21    #[error("invalid area data size")]
22    InvalidAreaData,
23
24    #[error(transparent)]
25    Build(#[from] landmark::BuildError),
26
27    #[error(transparent)]
28    Detour(#[from] waymark::DetourError),
29
30    #[cfg(feature = "serialization")]
31    #[error("serialization failed: {0}")]
32    Serialization(#[source] Box<dyn std::error::Error + Send + Sync>),
33
34    #[cfg(feature = "serialization")]
35    #[error(transparent)]
36    Io(#[from] std::io::Error),
37}