Skip to main content

skeg_rigging_net/
error.rs

1//! Umbrella network error.
2
3/// Errors surfaced by network-attached rigging adapters.
4#[derive(Debug, thiserror::Error)]
5#[non_exhaustive]
6pub enum NetError {
7    /// I/O failure on the underlying socket.
8    #[error("I/O error: {0}")]
9    Io(#[from] std::io::Error),
10
11    /// Wire protocol error (malformed frame, unexpected reply shape).
12    #[error("protocol error: {0}")]
13    Protocol(String),
14
15    /// Authentication failed.
16    #[error("authentication failed: {0}")]
17    Auth(String),
18
19    /// The remote returned an explicit error.
20    #[error("remote error: {0}")]
21    Remote(String),
22
23    /// JSON decoding of a [`crate::RecordEnvelope`] failed.
24    #[error("envelope decode: {0}")]
25    Envelope(#[from] serde_json::Error),
26
27    /// Server reply did not arrive within the configured timeout.
28    #[error("timeout")]
29    Timeout,
30
31    /// Op not supported over this transport (e.g. iter_vectors over RESP3
32    /// in v0.1).
33    #[error("operation not supported over this transport: {0}")]
34    Unsupported(&'static str),
35
36    /// Malformed [`crate::TenantLocation`] string.
37    #[error("malformed location: {0}")]
38    BadLocation(String),
39}