Skip to main content

aerostream_client/
error.rs

1use thiserror::Error;
2
3/// Core error types for the AeroStream client SDK.
4#[derive(Error, Debug)]
5pub enum AeroError {
6    /// Authentication handshake failed with broker.
7    #[error("Authentication failed: {0}")]
8    AuthFailed(String),
9
10    /// Protocol framing or decoding error.
11    #[error("Protocol error: {0}")]
12    ProtocolError(String),
13
14    /// Underlying I/O error occurred.
15    #[error("I/O error: {0}")]
16    Io(#[from] std::io::Error),
17
18    /// Out of order sequence number encountered during produce (status 45).
19    #[error("Out of order sequence number")]
20    OutOfOrder,
21
22    /// Connection to the broker was closed or disconnected.
23    #[error("Broker connection disconnected")]
24    Disconnected,
25
26    /// Operation timed out.
27    #[error("Operation timed out: {0}")]
28    Timeout(String),
29
30    /// Configuration parameters are invalid.
31    #[error("Invalid configuration: {0}")]
32    InvalidConfiguration(String),
33}