forecite 0.1.3

Official Rust SDK for the Forecite API — scored news feed (REST), Verdict scoring, and realtime WebSocket streaming.
Documentation
use thiserror::Error;

/// Errors returned by the Forecite client.
#[derive(Debug, Error)]
pub enum ForeciteError {
    /// A non-2xx API response, with the parsed `error.code` / `error.message`.
    #[error("Forecite API error (HTTP {status}, code: {code:?}): {message:?}")]
    Api {
        status: u16,
        code: Option<String>,
        message: Option<String>,
    },

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

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

    #[error("WebSocket error: {0}")]
    WebSocket(#[from] tokio_tungstenite::tungstenite::Error),
}