Skip to main content

DrizzleError

Enum DrizzleError 

Source
pub enum DrizzleError {
Show 19 variants ExecutionError(CompactString), PrepareError(CompactString), NotFound, TransactionError(CompactString), Mapping(CompactString), Statement(CompactString), Query(CompactString), QueryFailed { ctx: Box<QueryContext>, source: Box<DrizzleError>, }, ParameterError(CompactString), TryFromInt(TryFromIntError), ParseInt(ParseIntError), ParseFloat(ParseFloatError), ParseBool(ParseBoolError), ConversionError(CompactString), Schema(CompactString), UnsafeMigrationRepair { tag: CompactString, reason: CompactString, }, UnsupportedMigrationExecution { adapter: CompactString, requirement: CompactString, }, Other(CompactString), Infallible(Infallible),
}
Expand description

Every error a Drizzle query, conversion or migration can return.

Driver errors are wrapped in a variant for that driver when its feature is enabled. DrizzleError::QueryFailed adds the failing SQL and parameters to another error.

Variants§

§

ExecutionError(CompactString)

The statement failed to execute.

§

PrepareError(CompactString)

The statement failed to prepare.

§

NotFound

No row was returned where one was expected (for example by .get()).

§

TransactionError(CompactString)

A transaction could not begin, commit or roll back.

§

Mapping(CompactString)

A row could not be mapped to the target type.

§

Statement(CompactString)

The statement is invalid.

§

Query(CompactString)

The query is invalid.

§

QueryFailed

Another error, with the SQL and parameters of the query that caused it.

Fields

§ctx: Box<QueryContext>

Captured SQL and parameter context.

§source: Box<DrizzleError>

Original error.

§

ParameterError(CompactString)

Parameters could not be bound: missing, duplicate or unexpected bindings, or a value that could not be converted.

§

TryFromInt(TryFromIntError)

An integer did not fit the target type.

§

ParseInt(ParseIntError)

Text could not be parsed as an integer.

§

ParseFloat(ParseFloatError)

Text could not be parsed as a float.

§

ParseBool(ParseBoolError)

Text could not be parsed as a boolean.

§

ConversionError(CompactString)

A value could not be converted to the requested type.

§

Schema(CompactString)

The schema is invalid (for example a cycle in table dependencies).

§

UnsafeMigrationRepair

A dirty migration cannot be repaired without violating its execution safety contract.

Fields

§tag: CompactString

Migration tag recorded in the tracking table.

§reason: CompactString

Safety requirement that prevents automatic repair.

§

UnsupportedMigrationExecution

The selected adapter cannot provide a migration’s required execution semantics.

Fields

§adapter: CompactString

Runtime adapter that cannot provide the required semantics.

§requirement: CompactString

Migration execution capability the adapter does not provide.

§

Other(CompactString)

Any other error.

§

Infallible(Infallible)

Never constructed; lets ? work on infallible conversions.

Trait Implementations§

Source§

impl Debug for DrizzleError

Source§

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

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

impl Display for DrizzleError

Source§

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

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

impl Error for DrizzleError

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

impl From<!> for DrizzleError

Source§

fn from(source: Infallible) -> Self

Converts to this type from the input type.
Source§

impl From<ParseBoolError> for DrizzleError

Source§

fn from(source: ParseBoolError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseFloatError> for DrizzleError

Source§

fn from(source: ParseFloatError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for DrizzleError

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for DrizzleError

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.

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, 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<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<T> ToCompactString for T
where T: Display,

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> TypeEq<T> for T