lwgeom/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = core::result::Result<T, LWGeomError>;
4
5#[derive(Debug, Error)]
6pub enum LWGeomError {
7    #[error("failed to new CString")]
8    CStringError(#[from] std::ffi::NulError),
9    #[error("the ptr should not be null")]
10    NullPtrError,
11    #[error("function `{0}` parameter `{1}` is invalid")]
12    InvalidParameterError(String, String),
13    #[error("failed to calculate function `{0}` result")]
14    CalculateError(String),
15    #[error("failed to parse WKT: {0}")]
16    WKTParseError(String),
17    #[error("failed to call function `{0}`, but no error message returned")]
18    FailedWithoutMessageError(String),
19}