1use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum Error {
7 #[error("I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("Invalid tile coordinates: z={0}, x={1}, y={2}")]
11 InvalidCoordinates(u8, u32, u32),
12
13 #[error("Invalid timestamp: {0}")]
14 InvalidTimestamp(u64),
15
16 #[error("Compression error: {0}")]
17 Compression(String),
18
19 #[error("Decompression error: {0}")]
20 Decompression(String),
21
22 #[error("Invalid archive format: {0}")]
23 InvalidArchive(String),
24
25 #[error("Tile not found: {0:?}")]
26 TileNotFound(crate::tile::TileId),
27
28 #[error("Index error: {0}")]
29 Index(String),
30
31 #[error("Geometry error: {0}")]
32 Geometry(String),
33
34 #[error("Invalid magic number")]
35 InvalidMagic,
36
37 #[error("Unsupported version: {0}")]
38 UnsupportedVersion(u8),
39
40 #[error("Other error: {0}")]
41 Other(String),
42}
43
44pub type Result<T> = std::result::Result<T, Error>;