peasy-document 0.2.4

Rust client for PeasyDocument — document format tools, glossary, and guides API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

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

    #[error("Not found: {resource} '{identifier}'")]
    NotFound { resource: String, identifier: String },

    #[error("API error (HTTP {status}): {body}")]
    Api { status: u16, body: String },

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

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