//! Error types for HTTP client

use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("HTTP request failed: {0}")]
    RequestFailed(String),

    #[error("Connection timeout after {0}s")]
    ConnectionTimeout(u64),

    #[error("Request timeout after {0}s")]
    RequestTimeout(u64),

    #[error("Too many redirects (>{0})")]
    TooManyRedirects(u32),

    #[error("TLS error: {0}")]
    TlsError(String),

    #[error("Invalid configuration: {0}")]
    InvalidConfig(String),

    #[error("Retry limit exceeded ({0} attempts)")]
    RetryLimitExceeded(u32),

    #[error("Reqwest error: {0}")]
    Reqwest(#[from] reqwest::Error),
}

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