use thiserror::Error;
#[derive(Error, Debug)]
pub enum HeraldError {
#[error("Configuration error: {0}")]
Config(String),
#[error("Twitter API error: {0}")]
Twitter(String),
#[error("LLM API error: {0}")]
Llm(String),
#[error("Git error: {0}")]
Git(String),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Template error: {0}")]
Template(String),
#[error("Rate limit exceeded, retry after: {0}")]
RateLimit(String),
#[error("Authentication failed: {0}")]
Auth(String),
#[error("Tweet exceeds {max} characters (got {actual})")]
TweetTooLong { max: usize, actual: usize },
#[error("No events found to announce")]
NoEvents,
#[error("Scheduling error: {0}")]
Schedule(String),
}
pub type Result<T> = std::result::Result<T, HeraldError>;