scirs2_spatial/error.rs
1//! Error types for the SciRS2 spatial module
2
3use thiserror::Error;
4
5/// Spatial error type
6#[derive(Error, Debug)]
7pub enum SpatialError {
8 /// Computation error (generic error)
9 #[error("Computation error: {0}")]
10 ComputationError(String),
11
12 /// Dimension mismatch error
13 #[error("Dimension mismatch error: {0}")]
14 DimensionError(String),
15
16 /// Value error (invalid value)
17 #[error("Value error: {0}")]
18 ValueError(String),
19
20 /// Not implemented error
21 #[error("Not implemented: {0}")]
22 NotImplementedError(String),
23
24 /// Invalid input error
25 #[error("Invalid input: {0}")]
26 InvalidInput(String),
27}
28
29/// Result type for spatial operations
30pub type SpatialResult<T> = Result<T, SpatialError>;