Enum scylla::transport::errors::DbError

source ·
pub enum DbError {
Show 20 variants SyntaxError, Invalid, AlreadyExists { keyspace: String, table: String, }, FunctionFailure { keyspace: String, function: String, arg_types: Vec<String>, }, AuthenticationError, Unauthorized, ConfigError, Unavailable { consistency: Consistency, required: i32, alive: i32, }, Overloaded, IsBootstrapping, TruncateError, ReadTimeout { consistency: Consistency, received: i32, required: i32, data_present: bool, }, WriteTimeout { consistency: Consistency, received: i32, required: i32, write_type: WriteType, }, ReadFailure { consistency: Consistency, received: i32, required: i32, numfailures: i32, data_present: bool, }, WriteFailure { consistency: Consistency, received: i32, required: i32, numfailures: i32, write_type: WriteType, }, Unprepared { statement_id: Bytes, }, ServerError, ProtocolError, RateLimitReached { op_type: OperationType, rejected_by_coordinator: bool, }, Other(i32),
}
Expand description

An error sent from the database in response to a query as described in the specification\

Variants§

§

SyntaxError

The submitted query has a syntax error

§

Invalid

The query is syntactically correct but invalid

§

AlreadyExists

Attempted to create a keyspace or a table that was already existing

Fields

§keyspace: String

Created keyspace name or name of the keyspace in which table was created

§table: String

Name of the table created, in case of keyspace creation it’s an empty string

§

FunctionFailure

User defined function failed during execution

Fields

§keyspace: String

Keyspace of the failed function

§function: String

Name of the failed function

§arg_types: Vec<String>

Types of arguments passed to the function

§

AuthenticationError

Authentication failed - bad credentials

§

Unauthorized

The logged user doesn’t have the right to perform the query

§

ConfigError

The query is invalid because of some configuration issue

§

Unavailable

Not enough nodes are alive to satisfy required consistency level

Fields

§consistency: Consistency

Consistency level of the query

§required: i32

Number of nodes required to be alive to satisfy required consistency level

§alive: i32

Found number of active nodes

§

Overloaded

The request cannot be processed because the coordinator node is overloaded

§

IsBootstrapping

The coordinator node is still bootstrapping

§

TruncateError

Error during truncate operation

§

ReadTimeout

Not enough nodes responded to the read request in time to satisfy required consistency level

Fields

§consistency: Consistency

Consistency level of the query

§received: i32

Number of nodes that responded to the read request

§required: i32

Number of nodes required to respond to satisfy required consistency level

§data_present: bool

Replica that was asked for data has responded

§

WriteTimeout

Not enough nodes responded to the write request in time to satisfy required consistency level

Fields

§consistency: Consistency

Consistency level of the query

§received: i32

Number of nodes that responded to the write request

§required: i32

Number of nodes required to respond to satisfy required consistency level

§write_type: WriteType

Type of write operation requested

§

ReadFailure

A non-timeout error during a read request

Fields

§consistency: Consistency

Consistency level of the query

§received: i32

Number of nodes that responded to the read request

§required: i32

Number of nodes required to respond to satisfy required consistency level

§numfailures: i32

Number of nodes that experience a failure while executing the request

§data_present: bool

Replica that was asked for data has responded

§

WriteFailure

A non-timeout error during a write request

Fields

§consistency: Consistency

Consistency level of the query

§received: i32

Number of nodes that responded to the read request

§required: i32

Number of nodes required to respond to satisfy required consistency level

§numfailures: i32

Number of nodes that experience a failure while executing the request

§write_type: WriteType

Type of write operation requested

§

Unprepared

Tried to execute a prepared statement that is not prepared. Driver should prepare it again

Fields

§statement_id: Bytes

Statement id of the requested prepared query

§

ServerError

Internal server error. This indicates a server-side bug

§

ProtocolError

Invalid protocol message received from the driver

§

RateLimitReached

Rate limit was exceeded for a partition affected by the request. (Scylla-specific) TODO: Should this have a “Scylla” prefix?

Fields

§op_type: OperationType

Type of the operation rejected by rate limiting.

§rejected_by_coordinator: bool

Whether the operation was rate limited on the coordinator or not. Writes rejected on the coordinator are guaranteed not to be applied on any replica.

§

Other(i32)

Other error code not specified in the specification

Implementations§

source§

impl DbError

source

pub fn code(&self, protocol_features: &ProtocolFeatures) -> i32

Trait Implementations§

source§

impl Clone for DbError

source§

fn clone(&self) -> DbError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DbError

source§

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

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

impl Display for DbError

source§

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

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

impl Error for DbError

1.30.0 · source§

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

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
source§

impl PartialEq for DbError

source§

fn eq(&self, other: &DbError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for DbError

source§

impl StructuralPartialEq for DbError

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

source§

default 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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

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