maxbot 0.1.3

Автоматизация работы с чат-ботами MAX
Documentation
use thiserror::Error;

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

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

    #[error("Invalid input: {0}")]
    InvalidInput(String),

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

    #[error("Rate limit exceeded")]
    RateLimit,

    #[error("Attachment not ready")]
    AttachmentNotReady,

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

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