Skip to main content

oximedia_analytics/
error.rs

1//! Error types for the analytics crate.
2
3/// Errors produced by media engagement analytics operations.
4#[derive(Debug, Clone, PartialEq, thiserror::Error)]
5pub enum AnalyticsError {
6    /// The viewer session is invalid or malformed.
7    #[error("invalid session")]
8    InvalidSession,
9
10    /// An input value is invalid (bad range, empty slice, etc.).
11    #[error("invalid input: {0}")]
12    InvalidInput(String),
13
14    /// Not enough data to perform the requested analysis.
15    #[error("insufficient data: {0}")]
16    InsufficientData(String),
17
18    /// A statistical computation failed.
19    #[error("statistical error: {0}")]
20    StatisticalError(String),
21
22    /// Configuration is invalid or missing.
23    #[error("config error: {0}")]
24    ConfigError(String),
25
26    /// The experiment has no variants defined.
27    #[error("experiment '{0}' has no variants")]
28    NoVariants(String),
29
30    /// All variant allocation weights are zero or negative.
31    #[error("experiment '{0}' has invalid (zero/negative) weights")]
32    InvalidWeights(String),
33}