#[non_exhaustive]pub enum ArcadeDbError {
Connect {
addr: String,
attempts: u32,
source: Option<Error>,
},
InvalidEndpoint {
addr: String,
source: InvalidUri,
},
Rpc {
operation: String,
detail: String,
status: Status,
},
AlreadyExists {
what: String,
message: String,
},
CommandFailed {
operation: String,
message: String,
affected: Option<i64>,
},
Decode {
what: String,
source: RecordDecodeError,
},
NotFound {
operation: String,
detail: String,
},
InvalidInput {
message: String,
},
}Expand description
The error type for all client operations.
Variants are grouped by failure category; see each variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect
The connect retry loop exhausted its attempts (cold server that never
came up, wrong address, …). source is the last transport error when
at least one attempt got that far.
Fields
InvalidEndpoint
The endpoint string could not be parsed into a gRPC endpoint.
Rpc
A gRPC call failed at the transport/status layer. The full
tonic::Status is preserved — use ArcadeDbError::code to branch
on the gRPC code (e.g. retry on Unavailable, fail fast on
Unauthenticated).
Fields
AlreadyExists
The server rejected the operation because the target already exists
(database, type, property, index). Normalized from both transport
failures and success = false responses — the engine reports this
only through the error message (no structured gRPC code yet), so the
client detects it once at its boundary; matching this variant is the
stable consumer-facing contract.
Fields
CommandFailed
The server processed the request but answered success = false.
Fields
Decode
A typed decode of a returned record failed (e.g. the TryFrom<&GrpcRecord>
in lookup).
Fields
source: RecordDecodeErrorThe typed decode failure — missing field, type mismatch, ….
NotFound
A read that was expected to return at least one row returned none
(fetch_one,
QueryResult::one,
upsert_returning).
Distinct from Rpc — the transport and the command both succeeded;
the empty result is the answer.
Fields
InvalidInput
Client-side validation rejected the call before it hit the wire
(e.g. a bulk_upsert_dtos DTO without #[record(key)] columns).
Implementations§
Source§impl ArcadeDbError
impl ArcadeDbError
Sourcepub fn code(&self) -> Option<Code>
pub fn code(&self) -> Option<Code>
The gRPC status code, when this error carries a tonic::Status
(only Rpc does). Useful for retry/fail-fast
branching without matching the variant structure.
Sourcepub fn server_message(&self) -> Option<&str>
pub fn server_message(&self) -> Option<&str>
The server’s own error message, when there is one
(ArcadeDbError::Rpc, ArcadeDbError::CommandFailed, and
ArcadeDbError::AlreadyExists carry it).
Trait Implementations§
Source§impl Debug for ArcadeDbError
impl Debug for ArcadeDbError
Source§impl Display for ArcadeDbError
impl Display for ArcadeDbError
Source§impl Error for ArcadeDbError
impl Error for ArcadeDbError
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 !RefUnwindSafe for ArcadeDbError
impl !UnwindSafe for ArcadeDbError
impl Freeze for ArcadeDbError
impl Send for ArcadeDbError
impl Sync for ArcadeDbError
impl Unpin for ArcadeDbError
impl UnsafeUnpin for ArcadeDbError
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> 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