use thiserror::Error;
#[derive(Debug, Error)]
pub enum AnomalyError {
#[error("insufficient data: need at least {min}, got {got}")]
InsufficientData {
min: usize,
got: usize,
},
#[error("invalid input: {0}")]
InvalidInput(String),
#[error("invalid threshold: {0}")]
InvalidThreshold(String),
#[error("detector not fitted — call fit() before detect()")]
NotFitted,
#[error("forecast error: {0}")]
Forecast(String),
}