fourchan-rs 0.1.1

Async 4chan JSON API client and type bindings
Documentation
use thiserror::Error;

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

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

    #[error("resource not found: {0}")]
    NotFound(String),

    #[error("4chan API returned status {status} for {url}")]
    Status { status: u16, url: String },

    #[error("invalid header value: {0}")]
    InvalidHeader(String),
}

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