Skip to main content

openeruka_client/
error.rs

1//! Client error types.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum ClientError {
7    #[error("network error: {0}")]
8    Network(#[from] reqwest::Error),
9
10    #[error("unauthorized — check your API key")]
11    Unauthorized,
12
13    #[error("conflict — write rejected by knowledge state invariant (409)")]
14    Conflict,
15
16    #[error("not found")]
17    NotFound,
18
19    #[error("server error: {status} — {body}")]
20    Server { status: u16, body: String },
21
22    #[error("parse error: {0}")]
23    Parse(#[from] serde_json::Error),
24}