Skip to main content

geometry_kernel/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, GeometryError>;
4
5#[derive(Debug, Error, Clone, PartialEq)]
6pub enum GeometryError {
7    #[error("invalid geometry: {0}")]
8    InvalidGeometry(String),
9    #[error("unsupported operation: {0}")]
10    Unsupported(String),
11    #[error("backend error: {0}")]
12    Backend(String),
13    #[error("serialization error: {0}")]
14    Serialization(String),
15}
16
17impl From<serde_json::Error> for GeometryError {
18    fn from(value: serde_json::Error) -> Self {
19        Self::Serialization(value.to_string())
20    }
21}