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
InvalidMerge
There was an error with the SQL query
ValueTooDeep
A value is nested deeper than the engine will walk
InvalidPatch(PatchError)
There was an error with the provided JSON Patch
PatchTest
Given test operation failed for JSON Patch
InvalidFunctionArguments
The wrong quantity or magnitude of arguments was given for the specified function
InvalidMethodArguments
The wrong quantity or magnitude of arguments was given for the specified method
InvalidRegex(String)
Invalid regular expression
IdInvalid
Found a record id for the record but this is not a valid id
TbInvalid
Found a table name for the record but this is not a valid table
UnsupportedDestructure
A destructuring variant was used in a context where it is not supported
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
impl Error
Sourcepub fn is_ignorable(&self) -> bool
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 Error for Error
impl Error for Error
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()
Source§impl From<CoerceError> for Error
impl From<CoerceError> for Error
Source§fn from(source: CoerceError) -> Self
fn from(source: CoerceError) -> Self
Source§impl From<Error> for ControlFlow
impl From<Error> for ControlFlow
Source§fn from(error: Error) -> Self
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.