#[non_exhaustive]pub enum OxiaError {
}Expand description
Errors returned by the Oxia client.
The variants fall into three groups:
- Semantic results callers commonly match on (
KeyNotFound,UnexpectedVersionId,SessionExpired,RequestTooLarge,InvalidArgument). These are never retryable. - Transient failures that the client’s background loops (and, in a later
phase, its operation-level retries) may retry:
LeaderNotFound,NoShardForKey,Disconnected, and someGrpccodes. SeeOxiaError::is_retryable. - Terminal failures:
Timeout,Decode,Closed, and the remainingGrpccodes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
KeyNotFound
The requested key does not exist.
UnexpectedVersionId
A conditional operation failed because the stored version did not match the expected one.
SessionExpired
The session backing an ephemeral record has expired or been closed.
RequestTooLarge
A single request, or a batch that cannot be split further, exceeds the server’s maximum message size.
InvalidArgument(String)
An option or argument passed to an operation was invalid.
LeaderNotFound
No leader is currently available for the shard (e.g. a leader election is in progress). Retryable.
NoShardForKey
No shard currently owns the key, because shard assignments have not been loaded yet or are momentarily incomplete. Retryable.
Disconnected(String)
The connection to a server was lost or could not be established, or an in-flight request’s worker went away. Retryable.
Timeout
An operation did not complete before its deadline.
Grpc
The server returned a gRPC status. Whether it is retryable depends on the
code (see OxiaError::is_retryable).
Decode(String)
A server response could not be decoded — a required field was missing, or the response did not match the request. Indicates a protocol mismatch or a server bug.
ShardMoved
A shard was split or merged while an operation targeted it. The client re-routes such operations to the new shard automatically, so this is not normally observed. Retryable (by re-routing).
Closed
The client has been shut down and can no longer be used.
Implementations§
Source§impl OxiaError
impl OxiaError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether retrying the operation that produced this error might succeed.
Mirrors the retryable set of the reference Go client: connection loss,
missing shard leaders / assignments, and the UNAVAILABLE / ABORTED /
CANCELLED gRPC codes (the last being a shutting-down server’s own
cancellation propagating). Semantic results (e.g.
KeyNotFound) and terminal failures are not
retryable.
Trait Implementations§
Source§impl Error for OxiaError
impl Error for OxiaError
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()
Auto Trait Implementations§
impl Freeze for OxiaError
impl RefUnwindSafe for OxiaError
impl Send for OxiaError
impl Sync for OxiaError
impl Unpin for OxiaError
impl UnsafeUnpin for OxiaError
impl UnwindSafe for OxiaError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request