youtubeinfo-sync 1.0.2

Download YouTube video and channel metadata
use thiserror::Error;

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

#[derive(Error, Debug)]
pub enum YouTubeError {
    #[error("HTTP request failed: {0}")]
    Http(#[from] reqwest::Error),

    #[error("YouTube API error: {status} - {message} (endpoint: {endpoint})")]
    Api {
        status: u16,
        message: String,
        endpoint: String,
    },

    #[error("Configuration error: {0}")]
    Config(String),

    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("JSON serialization error: {0}")]
    Json(#[from] serde_json::Error),

    #[error("TOML parsing error: {0}")]
    Toml(#[from] toml::de::Error),

    #[error("Missing API key: YOUTUBE_API_KEY environment variable not set")]
    MissingApiKey,

    #[error("Quota exceeded: YouTube API daily quota limit reached")]
    QuotaExceeded,
}