Skip to main content

quant_indicators/
error.rs

1//! Error types for indicator calculations.
2
3use thiserror::Error;
4
5/// Errors that can occur during indicator computation.
6#[derive(Debug, Error, PartialEq, Eq, Clone)]
7pub enum IndicatorError {
8    /// Not enough data points to compute the indicator.
9    #[error("insufficient data: need {required} candles, got {actual}")]
10    InsufficientData { required: usize, actual: usize },
11
12    /// Invalid parameter for indicator configuration.
13    #[error("invalid parameter: {message}")]
14    InvalidParameter { message: String },
15}