pub enum VmError {
Show 33 variants
Panic {
reason: Panic,
},
Overflow,
Underflow,
DivideByZero,
UserError {
error: Error,
},
StackError {
error: StackError,
},
MissingFunction {
hash: Hash,
},
MissingModule {
module: Hash,
},
MissingModuleFunction {
module: Hash,
hash: Hash,
},
IpOutOfBounds,
UnsupportedBinaryOperation {
op: &'static str,
lhs: ValueTypeInfo,
rhs: ValueTypeInfo,
},
UnsupportedUnaryOperation {
op: &'static str,
operand: ValueTypeInfo,
},
UnsupportedObjectKey {
actual: ValueTypeInfo,
},
StackOutOfBounds,
MissingStaticString {
slot: usize,
},
MissingStaticObjectKeys {
slot: usize,
},
StackTopTypeError {
expected: ValueTypeInfo,
actual: ValueTypeInfo,
},
StackConversionError {
error: StackError,
from: ValueTypeInfo,
to: &'static str,
},
ArgumentConversionError {
error: StackError,
arg: usize,
from: ValueTypeInfo,
to: &'static str,
},
ArgumentCountMismatch {
actual: usize,
expected: usize,
},
ReturnConversionError {
error: StackError,
ret: &'static str,
},
UnsupportedIndexSet {
target_type: ValueTypeInfo,
index_type: ValueTypeInfo,
value_type: ValueTypeInfo,
},
UnsupportedIndexGet {
target_type: ValueTypeInfo,
index_type: ValueTypeInfo,
},
UnsupportedArrayIndexGet {
target_type: ValueTypeInfo,
},
UnsupportedObjectSlotIndexGet {
target_type: ValueTypeInfo,
},
UnsupportedIs {
value_type: ValueTypeInfo,
test_type: ValueTypeInfo,
},
UnsupportedReplaceDeref {
target_type: ValueTypeInfo,
value_type: ValueTypeInfo,
},
UnsupportedDeref {
actual_type: ValueTypeInfo,
},
MissingType {
hash: Hash,
},
IllegalPtrReplace {
target_ptr: usize,
value_ptr: usize,
},
UnsupportedCallFn {
actual_type: ValueTypeInfo,
},
ArrayIndexMissing {
index: usize,
},
ObjectIndexMissing {
slot: usize,
},
}Expand description
Errors raised by the execution of the virtual machine.
Variants§
Panic
The virtual machine panicked for no specific reason.
Overflow
The virtual machine encountered a numerical overflow.
Underflow
The virtual machine encountered a numerical underflow.
DivideByZero
The virtual machine encountered a divide-by-zero.
UserError
Error raised in a user-defined function.
StackError
Failure to interact with the stack.
Fields
error: StackErrorSource error.
MissingFunction
Failure to lookup function.
MissingModule
Failure to lookup module.
MissingModuleFunction
Failure to lookup function in a module.
IpOutOfBounds
Instruction pointer went out-of-bounds.
UnsupportedBinaryOperation
Unsupported binary operation.
UnsupportedUnaryOperation
Unsupported unary operation.
UnsupportedObjectKey
Unsupported argument to object-exact-keys.
Fields
actual: ValueTypeInfoThe encountered argument.
StackOutOfBounds
Attempt to access out-of-bounds stack item.
MissingStaticString
Indicates that a static string is missing for the given slot.
MissingStaticObjectKeys
Indicates that a static object keys is missing for the given slot.
StackTopTypeError
Saw an unexpected stack value.
StackConversionError
Indicates a failure to convert from one type to another.
Fields
error: StackErrorThe source of the error.
from: ValueTypeInfoThe actual type to be converted.
ArgumentConversionError
Failure to convert from one type to another.
Fields
error: StackErrorThe underlying stack error.
from: ValueTypeInfoThe value type we attempted to convert from.
ArgumentCountMismatch
Wrong number of arguments provided in call.
Fields
ReturnConversionError
Failure to convert return value.
Fields
error: StackErrorError describing the failed conversion.
UnsupportedIndexSet
An index set operation that is not supported.
Fields
target_type: ValueTypeInfoThe target type to set.
index_type: ValueTypeInfoThe index to set.
value_type: ValueTypeInfoThe value to set.
UnsupportedIndexGet
An index get operation that is not supported.
Fields
target_type: ValueTypeInfoThe target type to get.
index_type: ValueTypeInfoThe index to get.
UnsupportedArrayIndexGet
An array index get operation that is not supported.
Fields
target_type: ValueTypeInfoThe target type we tried to perform the array indexing on.
UnsupportedObjectSlotIndexGet
An object slot index get operation that is not supported.
Fields
target_type: ValueTypeInfoThe target type we tried to perform the object indexing on.
UnsupportedIs
An is operation is not supported.
Fields
value_type: ValueTypeInfoThe argument that is not supported.
test_type: ValueTypeInfoThe type that is not supported.
UnsupportedReplaceDeref
Encountered a value that could not be dereferenced.
Fields
target_type: ValueTypeInfoThe type we try to assign to.
value_type: ValueTypeInfoThe type we try to assign.
UnsupportedDeref
Encountered a value that could not be dereferenced.
Fields
actual_type: ValueTypeInfoThe type that could not be de-referenced.
MissingType
Missing type.
IllegalPtrReplace
Attempting to assign an illegal pointer.
Fields
UnsupportedCallFn
Encountered a value that could not be called as a function
Fields
actual_type: ValueTypeInfoThe type that could not be called.
ArrayIndexMissing
Tried to fetch an index in an array that doesn’t exist.
ObjectIndexMissing
Tried to fetch an index in an object that doesn’t exist.
Trait Implementations§
Source§impl Error for VmError
impl Error for VmError
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
Source§impl Error for VmError
impl Error for VmError
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.