pub enum ErrorCause<C: CustomTypes<S>, S: System<C>> {
Show 29 variants
UndefinedVariable {
name: CompactString,
},
UndefinedCostume {
name: CompactString,
},
UndefinedSound {
name: CompactString,
},
UndefinedEntity {
name: CompactString,
},
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: i64,
len: usize,
},
IndexNotInteger {
index: f64,
},
NoteNotInteger {
note: f64,
},
NoteNotMidi {
note: CompactString,
},
InvalidSize {
value: f64,
},
InvalidUnicode {
value: f64,
},
CallDepthLimit {
limit: usize,
},
ClosureArgCount {
expected: usize,
got: usize,
},
CyclicValue,
NotCsv {
value: CompactString,
},
NotJson {
value: CompactString,
},
ToSimpleError {
error: ToSimpleError<C, S>,
},
IntoJsonError {
error: IntoJsonError<C, S>,
},
FromJsonError {
error: FromJsonError,
},
FromNetsBloxJsonError {
error: FromNetsBloxJsonError,
},
NumberError {
error: NumberError,
},
NotSupported {
feature: Feature,
},
Promoted {
error: CompactString,
},
Custom {
msg: CompactString,
},
}
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.
Fields
name: CompactString
UndefinedCostume
A name-based costume lookup operation failed.
Fields
name: CompactString
UndefinedSound
A name-based sound lookup operation failed.
Fields
name: CompactString
UndefinedEntity
A name-based entity lookup operation failed.
Fields
name: CompactString
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
.
NoteNotInteger
Attempt to create a MIDI note value which was not an integer.
NoteNotMidi
Attempt to create a MIDI note with a value outside the allowed MIDI range.
Fields
note: CompactString
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.
NotCsv
Attempt to parse an invalid CSV-encoded string.
Fields
value: CompactString
NotJson
Attempt to parse an invalid JSON-encoded string.
Fields
value: CompactString
ToSimpleError
A failed attempt to convert a native vm Value
to SimpleValue
.
Fields
error: ToSimpleError<C, S>
IntoJsonError
A failed attempt to convert a SimpleValue
to Json
.
Fields
error: IntoJsonError<C, S>
FromJsonError
A failed attempt to convert a Json
value into a SimpleValue
for use in the vm.
Fields
error: FromJsonError
FromNetsBloxJsonError
A failed attempt to convert a Json
value from NetsBlox into a SimpleValue
for use in the vm.
Fields
error: FromNetsBloxJsonError
NumberError
A numeric value took on an invalid value such as NaN.
Fields
error: NumberError
NotSupported
Attempt to use an unsupported feature.
Promoted
A soft error (e.g., RPC or syscall failure) was promoted to a hard error.
Fields
error: CompactString
Custom
A custom error generated explicitly from user code.
Fields
msg: CompactString