1use arrow2::error::Error as ArrowError;
2use thiserror::Error;
3use wasm_bindgen::JsError;
4
5#[derive(Error, Debug)]
6pub enum GeoArrowError {
7 #[error(transparent)]
8 ArrowError(Box<ArrowError>),
9
10 #[error("Internal error: `{0}`")]
11 InternalError(String),
12}
13
14pub type Result<T> = std::result::Result<T, GeoArrowError>;
15pub type WasmResult<T> = std::result::Result<T, JsError>;
16
17impl From<ArrowError> for GeoArrowError {
18 fn from(err: ArrowError) -> Self {
19 Self::ArrowError(Box::new(err))
20 }
21}