use thiserror::Error;
#[derive(Debug, Error)]
pub enum EvalError {
#[error("Insufficient data: need at least {required} samples, got {actual}")]
InsufficientData { required: usize, actual: usize },
#[error("Invalid parameter: {0}")]
InvalidParameter(String),
#[error("Statistical computation error: {0}")]
StatisticalError(String),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("Serialization error: {0}")]
SerializationError(#[from] serde_json::Error),
#[error("Missing required data: {0}")]
MissingData(String),
#[error("Threshold exceeded for {metric}: {value} (threshold: {threshold})")]
ThresholdExceeded {
metric: String,
value: f64,
threshold: f64,
},
}
pub type EvalResult<T> = Result<T, EvalError>;