pub enum Error {
Parse {
message: String,
pos: usize,
},
Unknown {
name: String,
},
Missing {
name: String,
},
OutOfRange {
index: i64,
len: usize,
},
Type {
operation: &'static str,
got: &'static str,
},
Overflow {
operation: &'static str,
},
DivideByZero {
operation: &'static str,
},
Function {
name: String,
message: String,
},
UnknownMethod {
name: String,
},
Convert {
message: String,
},
}Expand description
Everything acts-expr can fail with.
A parse error carries the byte offset in the source it stopped at; an evaluation error names the operation and the value type it could not apply to, because the same expression can be valid for one context and not for the next.
Variants§
Parse
The source is not a well-formed expression.
Unknown
An identifier is not in the context.
Missing
A member of an object (or an index of a list) does not exist.
OutOfRange
A list index is negative or past the end, with the length it was read against.
Type
An operand or receiver has no type for the operation.
Fields
Overflow
An arithmetic operation overflowed an i64.
DivideByZero
A division or remainder had a zero divisor.
Function
A native function (an injected method) failed.
UnknownMethod
The receiver of a method call is not an object and no function of that name is in the context.
Convert
A value could not cross the json bridge.
Implementations§
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()