use thiserror::Error;
#[derive(Error, Debug)]
pub enum WebhookError {
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("Message must have at least content or one embed")]
EmptyMessage,
#[error("Rate limited by Discord: retry after {retry_after_ms}ms")]
RateLimited { retry_after_ms: u64 },
#[error("Discord API error (HTTP {status}): {message}")]
ApiError { status: u16, message: String },
#[error("JSON serialization failed: {0}")]
Json(#[from] serde_json::Error),
#[error("Invalid webhook URL: {reason}")]
InvalidUrl { reason: &'static str },
#[error("Invalid thread ID: must be a non-empty numeric Discord snowflake")]
InvalidThreadId,
}