#[non_exhaustive]pub enum CelerisError {
Configuration(String),
Timeout(String),
Cancelled(String),
Transport(String),
NotConnected(String),
Backpressure(String),
OperationInProgress(String),
DeliveryUnknown(String),
Protocol {
message: String,
field: &'static str,
offset: usize,
},
Server(ServerError),
}Expand description
A failure the SDK detected, or an error frame the server sent.
The SDK’s own variants are a closed set and carry a message that names what failed and the rule or limit it broke. Such a message never carries input values, credentials or bytes the server sent. Match on the variant, never on the message.
There is no authentication variant: a handshake that the server refuses for
its credentials cannot be told apart from a network failure (DEV-02), so it
is reported as CelerisError::Transport.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Configuration(String)
Invalid input: options, identifiers, payload helpers, or credentials that a provider returned.
Timeout(String)
A connection attempt or a presence query ran past its deadline.
Cancelled(String)
An operation stopped because the channel closed or a newer attempt started.
Transport(String)
A failed connection: the credential provider failed, the handshake was refused, or the socket broke.
NotConnected(String)
An operation needs a connection that the channel does not have.
Backpressure(String)
The publish queue is full, or sending is paused after a rate limit. Retry once it drains.
OperationInProgress(String)
A second connect or presence query while the first is still running.
DeliveryUnknown(String)
A publish may or may not have left the socket. It is never resent automatically.
Protocol
A server message could not be decoded. The message is dropped and the connection stays up (DECODE-01).
Fields
Server(ServerError)
An error frame from the server, every field exactly as sent (ERR-01).
Trait Implementations§
Source§impl Clone for CelerisError
impl Clone for CelerisError
Source§impl Debug for CelerisError
impl Debug for CelerisError
Source§impl Display for CelerisError
impl Display for CelerisError
impl Eq for CelerisError
Source§impl Error for CelerisError
impl Error for CelerisError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()