#[non_exhaustive]pub enum Error {
ConnectionClosed,
NotAuthenticated,
AuthFailed(String),
Protocol(String),
Config(String),
Io(Error),
NoPending,
AllConnectionsFailed,
TooManyInFlight,
PendingOpsInFlight,
}Expand description
Errors that can occur when using the Momento client.
Marked #[non_exhaustive] because the crate is still evolving and new
transport / protocol error kinds are expected. Downstream match
blocks must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConnectionClosed
The connection was closed before a response was received.
NotAuthenticated
Not authenticated (auth command not yet completed).
AuthFailed(String)
Authentication with Momento failed.
Protocol(String)
Protocol-level error (malformed response, unexpected message type).
Config(String)
Configuration error (bad token, missing env var).
Io(Error)
I/O error during send or recv.
NoPending
recv() was called with no in-flight requests.
AllConnectionsFailed
All connections in the pool are down and reconnection failed.
TooManyInFlight
The in-flight pending-op map reached max_in_flight. Drain via
recv() before issuing more fire_* calls. Configurable via
crate::ClientBuilder::max_in_flight.
PendingOpsInFlight
A sequential API call (crate::Client::get / set / delete)
was issued while one or more fire_* ops were still in flight.
Momento is multiplexed and recv() returns whatever message_id
arrives first; the convenience APIs discard the id/key and would
silently return data for the wrong request. Drain recv() until
pending_count() == 0 before calling the sequential API, or use
fire_* + recv() exclusively.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()