#[non_exhaustive]pub enum ClientError {
Show 13 variants
Connect {
addr: String,
reason: String,
},
InvalidApiKey,
Transport(String),
Unauthenticated(String),
Overloaded(String),
InvalidRequest(String),
ServerInternal(String),
UnexpectedStatus {
code: Code,
message: String,
},
EmptyBatch,
BatchResultCountMismatch {
expected: usize,
got: usize,
},
MalformedResponse(&'static str),
MalformedJob(JobConversionError),
MalformedServerInfo(ServerInfoError),
}Expand description
The general client error type, shared by most RPCs.
gRPC status codes are mapped onto these variants: Unavailable /
DeadlineExceeded / Aborted / Cancelled become Transport,
ResourceExhausted becomes Overloaded, and so on. The
RetryPolicy retries Unavailable, DeadlineExceeded, and Aborted
(all surfacing as Transport) plus ResourceExhausted (Overloaded);
a Cancelled RPC also maps to Transport but is never retried.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect
Establishing the connection failed.
InvalidApiKey
The configured API key could not be encoded as an HTTP header value.
Transport(String)
A transient transport-level failure (connection dropped, deadline
exceeded, request aborted/cancelled). Generally safe to retry, though
the RetryPolicy does not retry cancelled RPCs, and retried enqueues
can duplicate jobs that carry no idempotency key.
Unauthenticated(String)
The server rejected the credentials (missing/invalid API key, or permission denied).
Overloaded(String)
The server is shedding load (ResourceExhausted); back off and retry.
InvalidRequest(String)
The server rejected the request as malformed (InvalidArgument).
ServerInternal(String)
The server hit an internal error (Internal / DataLoss / Unknown).
UnexpectedStatus
The server returned a status code this client does not map to a more specific variant.
EmptyBatch
An enqueue was attempted with no jobs.
BatchResultCountMismatch
The server returned a different number of results than jobs sent — a protocol violation.
MalformedResponse(&'static str)
A response was missing a field the protocol requires.
MalformedJob(JobConversionError)
A job in a response could not be decoded; see JobConversionError.
MalformedServerInfo(ServerInfoError)
A server-info response could not be decoded; see ServerInfoError.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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()
Source§impl From<ClientError> for EnqueueError
impl From<ClientError> for EnqueueError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<ClientError> for LeaseError
impl From<ClientError> for LeaseError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<ClientError> for ReserveError
impl From<ClientError> for ReserveError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<ClientError> for AtomicEnqueueError
impl From<ClientError> for AtomicEnqueueError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<JobConversionError> for ClientError
impl From<JobConversionError> for ClientError
Source§fn from(source: JobConversionError) -> Self
fn from(source: JobConversionError) -> Self
Source§impl From<ServerInfoError> for ClientError
impl From<ServerInfoError> for ClientError
Source§fn from(source: ServerInfoError) -> Self
fn from(source: ServerInfoError) -> Self
Auto Trait Implementations§
impl Freeze for ClientError
impl RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
impl UnwindSafe for ClientError
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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