Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 27 variants InvalidContent { value: Value, }, InvalidMerge { value: Value, }, ValueTooDeep { max: usize, }, InvalidPatch(PatchError), PatchTest { expected: String, got: String, }, InvalidFunctionArguments { name: String, message: String, }, InvalidMethodArguments { name: String, message: String, }, InvalidRegex(String), IdInvalid { value: String, }, TbInvalid { value: String, }, UnsupportedDestructure { variant: String, }, Coerce(CoerceError), Cast(CastError), TryAdd(String, String), TrySub(String, String), TryMul(String, String), TryDiv(String, String), TryRem(String, String), TryPow(String, String), TryNeg(String), TryExtend(String), TryFrom(String, &'static str), TimestampOverflow(String), Serialization(String), ArithmeticOverflow(String), ArithmeticNegativeOverflow(String), InvalidBytesize,
}
Expand description

A failure in the value algebra.

Variants§

§

InvalidContent

There was an error with the SQL query

Fields

§value: Value
§

InvalidMerge

There was an error with the SQL query

Fields

§value: Value
§

ValueTooDeep

A value is nested deeper than the engine will walk

Fields

§max: usize
§

InvalidPatch(PatchError)

There was an error with the provided JSON Patch

§

PatchTest

Given test operation failed for JSON Patch

Fields

§expected: String
§

InvalidFunctionArguments

The wrong quantity or magnitude of arguments was given for the specified function

Fields

§name: String
§message: String
§

InvalidMethodArguments

The wrong quantity or magnitude of arguments was given for the specified method

Fields

§name: String
§message: String
§

InvalidRegex(String)

Invalid regular expression

§

IdInvalid

Found a record id for the record but this is not a valid id

Fields

§value: String
§

TbInvalid

Found a table name for the record but this is not a valid table

Fields

§value: String
§

UnsupportedDestructure

A destructuring variant was used in a context where it is not supported

Fields

§variant: String
§

Coerce(CoerceError)

Unable to coerce to a value to another value

§

Cast(CastError)

Unable to convert a value to another value

§

TryAdd(String, String)

Cannot perform addition

§

TrySub(String, String)

Cannot perform subtraction

§

TryMul(String, String)

Cannot perform multiplication

§

TryDiv(String, String)

Cannot perform division

§

TryRem(String, String)

Cannot perform remainder

§

TryPow(String, String)

Cannot perform power

§

TryNeg(String)

Cannot perform negation

§

TryExtend(String)

Cannot extend a non-array value

§

TryFrom(String, &'static str)

It’s is not possible to convert between the two types

§

TimestampOverflow(String)

Represents a failure in timestamp arithmetic related to database internals

§

Serialization(String)

The supplied type could not be serialized into expr::Value

§

ArithmeticOverflow(String)

Represents an arithmetic result that does not fit the value’s type

§

ArithmeticNegativeOverflow(String)

Represents a negative value for a type that must be zero or positive

§

InvalidBytesize

Implementations§

Source§

impl Error

Source

pub fn is_ignorable(&self) -> bool

Returns true if this error represents a data-shape problem (type mismatch, coercion failure, bad operand pair) that expression evaluation may resolve to NONE instead of propagating.

Returns false for everything else, including the arithmetic failures that are not listed. Membership is decided per variant and is not a family rule: TryDiv and TryPow are ignorable, TryRem and TryFrom are not. Do not widen the list to make it look tidy.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<CastError> for Error

Source§

fn from(source: CastError) -> Self

Converts to this type from the input type.
Source§

impl From<CoerceError> for Error

Source§

fn from(source: CoerceError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ControlFlow

Source§

fn from(error: Error) -> Self

Boxes the value-algebra failure directly, so it stays the concrete type in the anyhow slot and ControlFlow::is_ignorable keeps matching it.

Source§

impl LeafError for Error

Source§

fn map_kind(self, message: String) -> TypesError

Classify this error: kind, details and code. Read more
Source§

fn to_types_error(self) -> Error

Produce the public error. Read more

Auto Trait Implementations§

§

impl !Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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<E> ErrorTrait for E
where E: Error + 'static,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<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
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool