1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[error("I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("TIFF writer error: {0}")]
11 Tiff(#[from] tiff_writer::Error),
12
13 #[error("invalid configuration: {0}")]
14 InvalidConfig(String),
15
16 #[error("tile ({x_off},{y_off}) out of bounds for {width}x{height} raster")]
17 TileOutOfBounds {
18 x_off: usize,
19 y_off: usize,
20 width: u32,
21 height: u32,
22 },
23
24 #[error("data size mismatch: expected {expected}, got {actual}")]
25 DataSizeMismatch { expected: usize, actual: usize },
26
27 #[error("{0}")]
28 Other(String),
29}