use thiserror::Error;

#[derive(Debug, Error)]
pub enum AnalyticsError {
    #[error("Pipeline error: {0}")]
    PipelineError(String),

    #[error("Event processing error: {0}")]
    ProcessingError(String),

    #[error("Aggregation error: {0}")]
    AggregationError(String),

    #[error("Storage error: {0}")]
    StorageError(String),

    #[error("Serialization error: {0}")]
    SerializationError(#[from] serde_json::Error),

    #[error("Channel send error: {0}")]
    ChannelError(String),
}

pub type Result<T> = std::result::Result<T, AnalyticsError>;
