Skip to main content

anofox_ml_core/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum RustMlError {
5    #[error("Shape mismatch: {0}")]
6    ShapeMismatch(String),
7
8    #[error("Not fitted: {0}")]
9    NotFitted(String),
10
11    #[error("Invalid parameter: {0}")]
12    InvalidParameter(String),
13
14    #[error("Empty input: {0}")]
15    EmptyInput(String),
16
17    #[error("IO error: {0}")]
18    Io(String),
19
20    #[error("Serialization error: {0}")]
21    Serialization(String),
22}
23
24pub type Result<T> = std::result::Result<T, RustMlError>;