chronix_analytics/anomaly/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum AnomalyError {
8 #[error("insufficient data: need at least {min}, got {got}")]
10 InsufficientData {
11 min: usize,
13 got: usize,
15 },
16
17 #[error("invalid input: {0}")]
19 InvalidInput(String),
20
21 #[error("invalid threshold: {0}")]
23 InvalidThreshold(String),
24
25 #[error("detector not fitted — call fit() before detect()")]
27 NotFitted,
28
29 #[error("forecast error: {0}")]
31 Forecast(String),
32}