Skip to main content

ArcadeDbError

Enum ArcadeDbError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§addr: String

The host:port that was retried.

§attempts: u32

How many connect attempts were made.

§source: Option<Error>

The last underlying transport error, if any attempt produced one.

§

InvalidEndpoint

The endpoint string could not be parsed into a gRPC endpoint.

Fields

§addr: String

The rejected endpoint string.

§source: InvalidUri

Why the URI parser rejected it.

§

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

§operation: String

What the client was doing, e.g. "query", "commit transaction".

§detail: String

The operation’s subject — the SQL text, rid, database name, … — empty when the operation has no natural subject.

§status: Status

The underlying gRPC status (code, message, metadata).

§

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

§what: String

What the client was doing, e.g. "create database".

§message: String

The server’s own explanation.

§

CommandFailed

The server processed the request but answered success = false.

Fields

§operation: String

What the client was doing, e.g. "commit transaction".

§message: String

The server’s own explanation.

§affected: Option<i64>

Records the server reported as affected, when it reports a count.

§

Decode

A typed decode of a returned record failed (e.g. the TryFrom<&GrpcRecord> in lookup).

Fields

§what: String

What was being decoded, e.g. "lookup record #12:0".

§source: RecordDecodeError

The 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

§operation: String

What was reading, e.g. "fetch_one".

§detail: String

The query or subject that came up empty.

§

InvalidInput

Client-side validation rejected the call before it hit the wire (e.g. a bulk_upsert_dtos DTO without #[record(key)] columns).

Fields

§message: String

What was rejected and why.

Implementations§

Source§

impl ArcadeDbError

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ArcadeDbError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ArcadeDbError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more