use thiserror::Error;

#[derive(Error, Debug)]
pub enum AppError {
    #[error("Configuration error: {0}")]
    Configuration(String),
    #[error("Service error: {0}")]
    ServiceRequest(#[from] reqwest::Error),
    #[error("NATS error: {0}")]
    Nats(#[from] async_nats::Error),
    #[error("Data parsing error: {0}")]
    DataParsing(#[from] anyhow::Error),
    // #[error("Unknown error: {0}")]
    // Unknown(String),
}

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

