molten-herald 0.1.0

Automated viral tweet generation and scheduling for developer releases 📢
Documentation
//! Error types for herald

use thiserror::Error;

/// Herald error type
#[derive(Error, Debug)]
pub enum HeraldError {
    /// Configuration error
    #[error("Configuration error: {0}")]
    Config(String),

    /// Twitter API error
    #[error("Twitter API error: {0}")]
    Twitter(String),

    /// LLM API error
    #[error("LLM API error: {0}")]
    Llm(String),

    /// Git error
    #[error("Git error: {0}")]
    Git(String),

    /// HTTP request error
    #[error("HTTP error: {0}")]
    Http(#[from] reqwest::Error),

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

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

    /// Template error
    #[error("Template error: {0}")]
    Template(String),

    /// Rate limit exceeded
    #[error("Rate limit exceeded, retry after: {0}")]
    RateLimit(String),

    /// Authentication error
    #[error("Authentication failed: {0}")]
    Auth(String),

    /// Tweet too long
    #[error("Tweet exceeds {max} characters (got {actual})")]
    TweetTooLong { max: usize, actual: usize },

    /// No events found
    #[error("No events found to announce")]
    NoEvents,

    /// Scheduling error
    #[error("Scheduling error: {0}")]
    Schedule(String),
}

/// Result type for herald operations
pub type Result<T> = std::result::Result<T, HeraldError>;