Skip to main content

trellis_client/
error.rs

1/// Errors returned by the Trellis client runtime.
2#[derive(thiserror::Error, Debug)]
3pub enum TrellisClientError {
4    #[error("invalid base64url: {0}")]
5    Base64(#[from] base64::DecodeError),
6
7    #[error("invalid ed25519 seed length: {0} (expected 32)")]
8    InvalidSeedLen(usize),
9
10    #[error("io error: {0}")]
11    Io(#[from] std::io::Error),
12
13    #[error("nats error: {0}")]
14    Nats(#[from] async_nats::Error),
15
16    #[error("nats connect error: {0}")]
17    NatsConnect(String),
18
19    #[error("nats request error: {0}")]
20    NatsRequest(String),
21
22    #[error("request timeout")]
23    Timeout,
24
25    #[error("invalid json: {0}")]
26    Json(#[from] serde_json::Error),
27
28    #[error("rpc returned error: {0}")]
29    RpcError(String),
30}