Enum netsblox_vm::runtime::ErrorCause
source · pub enum ErrorCause<C: CustomTypes<S>, S: System<C>> {
Show 23 variants
UndefinedVariable {
name: String,
},
UndefinedCostume {
name: String,
},
UndefinedEntity {
name: String,
},
UpvarAtRoot,
ConversionError {
got: Type<C, S>,
expected: Type<C, S>,
},
VariadicConversionError {
got: Type<C, S>,
expected: Type<C, S>,
},
Incomparable {
left: Type<C, S>,
right: Type<C, S>,
},
EmptyList,
InvalidListLength {
expected: usize,
got: usize,
},
IndexOutOfBounds {
index: f64,
len: usize,
},
IndexNotInteger {
index: f64,
},
InvalidSize {
value: f64,
},
InvalidUnicode {
value: f64,
},
CallDepthLimit {
limit: usize,
},
ClosureArgCount {
expected: usize,
got: usize,
},
CyclicValue,
NotJson {
value: String,
},
ToJsonError {
error: ToJsonError<C, S>,
},
FromJsonError {
error: FromJsonError,
},
NumberError {
error: NumberError,
},
NotSupported {
feature: Feature,
},
Promoted {
error: String,
},
Custom {
msg: String,
},
}Expand description
The cause/explanation of an execution error.
Variants§
UndefinedVariable
A variable lookup operation failed. name holds the name of the variable that was expected.
UndefinedCostume
A name-based costume lookup operation failed.
UndefinedEntity
A name-based entity lookup operation failed.
UpvarAtRoot
An upvar was created at the root scope, which is not allowed (it has nothing to refer up to).
ConversionError
The result of a failed type conversion.
VariadicConversionError
The result of a failed variadic type conversion (expected type T or a list of type T).
Incomparable
Attempt to compare incomparable types.
EmptyList
An operation that expected a non-empty list received an empty list as input.
InvalidListLength
An operation that expected a list with a certain size received an incorrect size.
IndexOutOfBounds
An indexing operation on a list/string had an out of bounds index, index, on a list/string of size len. Note that Snap!/NetsBlox use 1-based indexing.
IndexNotInteger
Attempt to index a list with a non-integer numeric value, index.
InvalidSize
Attempt to use a number which was not a valid size (must be convertible to usize).
InvalidUnicode
Attempt to interpret an invalid unicode code point (number) as a character.
CallDepthLimit
Exceeded the maximum call depth.
ClosureArgCount
Attempt to call a closure which required expected arguments, but got arguments were supplied.
CyclicValue
An acyclic operation received a cyclic input value.
NotJson
Attempt to parse an invalid JSON-encoded string.
ToJsonError
Fields
error: ToJsonError<C, S>FromJsonError
Fields
error: FromJsonErrorNumberError
Fields
error: NumberErrorA numeric value took on an invalid value such as NaN.
NotSupported
Attempt to use an unsupported feature.
Promoted
A soft error (e.g., RPC or syscall failure) was promoted to a hard error.
Custom
A custom error generated explicitly from user code.