geosets_rs/sets/
errors.rs

1use thiserror::Error;
2
3use crate::qhull_wrapper::ConvexHullError;
4
5#[derive(Error, Debug)]
6pub enum SetOperationError {
7    #[error("Dimension mismatch: expected {expected}, got {got}")]
8    DimensionMismatch { expected: usize, got: usize },
9
10    #[error("Operation not implemented")]
11    NotImplemented,
12
13    #[error("Data conversion error: {source}")]
14    DataConversionError {
15        #[source]
16        source: Box<dyn std::error::Error + Send + Sync>,
17    },
18
19    #[error("Unsupported operation, {message}")]
20    UnsupportedOperation { message: String },
21
22    #[error("Optimization failed: {source}")]
23    InfeasibleOptimization {
24        #[source]
25        source: Box<dyn std::error::Error + Send + Sync>,
26    },
27
28    #[error("ConvexHull error: {0}")]
29    QhullError(#[from] ConvexHullError),
30
31    #[error("Set is empty")]
32    EmptySet,
33}