use thiserror::Error;
use crate::TileId;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
#[non_exhaustive]
pub enum TileError {
#[error("extent must be between 1 and {}", i32::MAX)]
InvalidExtent,
#[error("buffer must be strictly less than half the extent")]
BufferTooLarge,
#[error(
"polyline too large: at most {0} lines, and {0} vertices per line, are supported",
u16::MAX
)]
PolylineTooLarge,
#[error("polyline reaches too many tiles to slice")]
TooManyTiles,
#[error("coordinate arithmetic overflowed the i32 range")]
Overflow,
#[error("tile conflicts with {} already-added tile(s)", .0.len())]
Conflict(Vec<TileId>),
}