use arrow_schema::ArrowError;
use std::fmt::Debug;
use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum GeoArrowError {
#[error("Not yet implemented: {0}")]
NotYetImplemented(String),
#[error("General error: {0}")]
General(String),
#[error(transparent)]
External(#[from] anyhow::Error),
#[error("Overflow")]
Overflow,
#[error(transparent)]
Arrow(#[from] ArrowError),
#[error(transparent)]
FailedToConvergeError(#[from] geo::vincenty_distance::FailedToConvergeError),
#[cfg(feature = "geozero")]
#[error(transparent)]
GeozeroError(#[from] geozero::error::GeozeroError),
#[cfg(feature = "geos")]
#[error(transparent)]
GeosError(#[from] geos::Error),
#[cfg(feature = "proj")]
#[error(transparent)]
ProjError(#[from] proj::ProjError),
#[cfg(feature = "flatgeobuf")]
#[error(transparent)]
FlatgeobufError(#[from] flatgeobuf::Error),
}
pub type Result<T> = std::result::Result<T, GeoArrowError>;