1use std::num::TryFromIntError;
4
5use thiserror::Error;
6
7#[derive(Error, Debug)]
9pub enum UtilesCoreError {
10 #[error("{0}")]
12 AdHoc(String),
13
14 #[error("tile parse error: {0}")]
16 TileParseError(String),
17
18 #[error("parse error: {0}")]
20 ParseError(String),
21
22 #[error("invalid tile: {0}")]
24 InvalidTile(String),
25
26 #[error("invalid quadkey: {0}")]
28 InvalidQuadkey(String),
29
30 #[error("invalid bbox: {0}")]
32 InvalidBbox(String),
33
34 #[error("invalid lnglat: {0}")]
36 InvalidLngLat(String),
37
38 #[error("invalid SRTM string: {0}")]
40 InvalidSrtmString(String),
41
42 #[error("invalid zoom(s): {0}")]
44 InvalidZoom(String),
45
46 #[error("invalid projection: {0}")]
48 InvalidProjection(String),
49
50 #[error("invalid json: {0}")]
52 InvalidJson(String),
53
54 #[error("conversion err: {0}")]
56 LngLat2WebMercator(String),
57
58 #[error("Unimplemented: {0}")]
60 Unimplemented(String),
61
62 #[error("io error: {0}")]
64 SerdeJsonError(#[from] serde_json::Error),
65
66 #[error("try-from-int: {0}")]
68 TryFromIntError(#[from] TryFromIntError),
69}
70
71pub type UtilesCoreResult<T> = Result<T, UtilesCoreError>;