Skip to main content

so_utils/
error.rs

1//! Error types for utility operations
2
3use thiserror::Error;
4
5/// Main error type for utility operations
6#[derive(Error, Debug)]
7pub enum UtilsError {
8    #[error("Data error: {0}")]
9    DataError(String),
10
11    #[error("Dimension mismatch: {0}")]
12    DimensionMismatch(String),
13
14    #[error("Numerical error: {0}")]
15    NumericalError(String),
16
17    #[error("Parse error: {0}")]
18    ParseError(String),
19
20    #[error("IO error: {0}")]
21    IoError(#[from] std::io::Error),
22
23    #[error("Serialization error: {0}")]
24    SerializationError(String),
25
26    #[error("Validation error: {0}")]
27    ValidationError(String),
28}
29
30/// Result type alias for utility operations
31pub type Result<T> = std::result::Result<T, UtilsError>;