//! Error types for metrics calculations.

use thiserror::Error;

/// Errors that can occur during metrics calculations.
#[derive(Debug, Error, PartialEq, Eq)]
pub enum MetricsError {
    /// Not enough data points for the calculation.
    #[error("insufficient data: need at least {required} points, got {actual}")]
    InsufficientData { required: usize, actual: usize },

    /// Division by zero would occur.
    #[error("division by zero: {context}")]
    DivisionByZero { context: &'static str },

    /// Invalid parameter value.
    #[error("invalid parameter: {0}")]
    InvalidParameter(String),
}
