1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#[cfg(feature = "unstable-cog")]
use super::cog::CogError;
#[cfg(feature = "unstable-duckdb")]
use super::duckdb::DuckDBError;
#[cfg(feature = "mbtiles")]
use super::mbtiles::MbtilesError;
#[cfg(feature = "passthrough")]
use super::passthrough::PassthroughError;
#[cfg(feature = "pmtiles")]
use super::pmtiles::PmtilesError;
#[cfg(feature = "postgres")]
use super::postgres::PostgresError;
/// Errors that can occur during tile processing operations.
#[non_exhaustive]
#[derive(thiserror::Error, Debug)]
pub enum MartinCoreError {
/// Errors that can occur during [`mbtiles`](crate::tiles::cog) processing operations.
#[cfg(feature = "mbtiles")]
#[error(transparent)]
MbtilesError(#[from] MbtilesError),
/// Errors that can occur during [`postgres`](crate::tiles::cog) processing operations.
#[cfg(feature = "postgres")]
#[error(transparent)]
PostgresError(#[from] PostgresError),
/// Errors that can occur during [`duckdb`](crate::tiles::duckdb) processing operations.
#[cfg(feature = "unstable-duckdb")]
#[error(transparent)]
DuckDBError(#[from] DuckDBError),
/// Errors that can occur during [`pmtiles`](crate::tiles::cog) processing operations.
#[cfg(feature = "pmtiles")]
#[error(transparent)]
PmtilesError(#[from] PmtilesError),
/// Errors that can occur during [`passthrough`](crate::tiles::passthrough) processing operations.
#[cfg(feature = "passthrough")]
#[error(transparent)]
PassthroughError(#[from] PassthroughError),
/// Errors that can occur during [`cog`](crate::tiles::cog) processing operations.
#[cfg(feature = "unstable-cog")]
#[error(transparent)]
CogError(#[from] CogError),
/// The tile source was modified since it was opened and must be reloaded before retrying.
///
/// Use of this error REQUIRES the `Source` to also implement `Source::try_reload()`.
#[error("Source was modified and needs to be reloaded")]
SourceNeedsReload,
/// Errors that can occur during [`geojson`](crate::tiles::geojson) processing operations.
#[cfg(feature = "geojson")]
#[error(transparent)]
GeoJsonError(#[from] super::geojson::GeoJsonError),
/// Errors occurring from other sources, not implemented by `martin-core`.
#[error(transparent)]
OtherError(#[from] Box<dyn std::error::Error + Send + Sync>),
}
/// A convenience [`Result`] for tiles coming from `martin-core`.
pub type MartinCoreResult<T> = Result<T, MartinCoreError>;