aduib_rpc/
error.rs

1use crate::types::AduibRpcError;
2use thiserror::Error;
3
4#[derive(Debug, Clone)]
5pub struct RemoteError(pub AduibRpcError);
6
7#[derive(Debug, Error)]
8pub enum AduibRpcClientError {
9    #[error("http status {status}: {body}")]
10    HttpStatus { status: u16, body: String },
11
12    #[error("network error: {0}")]
13    Network(#[from] reqwest::Error),
14
15    #[error("json error: {0}")]
16    Json(#[from] serde_json::Error),
17
18    #[error("remote returned error: {0:?}")]
19    Remote(RemoteError),
20
21    #[error("streaming feature not enabled")]
22    StreamingNotEnabled,
23}
24