Enum ErrorCause

Source
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

§

UndefinedCostume

A name-based costume lookup operation failed.

Fields

§

UndefinedSound

A name-based sound lookup operation failed.

Fields

§

UndefinedEntity

A name-based entity lookup operation failed.

Fields

§

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.

Fields

§got: Type<C, S>
§expected: Type<C, S>
§

VariadicConversionError

The result of a failed variadic type conversion (expected type T or a list of type T).

Fields

§got: Type<C, S>
§expected: Type<C, S>
§

Incomparable

Attempt to compare incomparable types.

Fields

§left: Type<C, S>
§right: Type<C, S>
§

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.

Fields

§expected: usize
§got: usize
§

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.

Fields

§index: i64
§len: usize
§

IndexNotInteger

Attempt to index a list with a non-integer numeric value, index.

Fields

§index: f64
§

NoteNotInteger

Attempt to create a MIDI note value which was not an integer.

Fields

§note: f64
§

NoteNotMidi

Attempt to create a MIDI note with a value outside the allowed MIDI range.

Fields

§

InvalidSize

Attempt to use a number which was not a valid size (must be convertible to usize).

Fields

§value: f64
§

InvalidUnicode

Attempt to interpret an invalid unicode code point (number) as a character.

Fields

§value: f64
§

CallDepthLimit

Exceeded the maximum call depth.

Fields

§limit: usize
§

ClosureArgCount

Attempt to call a closure which required expected arguments, but got arguments were supplied.

Fields

§expected: usize
§got: usize
§

CyclicValue

An acyclic operation received a cyclic input value.

§

NotCsv

Attempt to parse an invalid CSV-encoded string.

Fields

§

NotJson

Attempt to parse an invalid JSON-encoded string.

Fields

§

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

§

FromNetsBloxJsonError

A failed attempt to convert a Json value from NetsBlox into a SimpleValue for use in the vm.

§

NumberError

A numeric value took on an invalid value such as NaN.

Fields

§

NotSupported

Attempt to use an unsupported feature.

Fields

§feature: Feature
§

Promoted

A soft error (e.g., RPC or syscall failure) was promoted to a hard error.

Fields

§

Custom

A custom error generated explicitly from user code.

Fields

Trait Implementations§

Source§

impl<C: CustomTypes<S>, S: System<C>> Debug for ErrorCause<C, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: CustomTypes<S>, S: System<C>> From<ConversionError<C, S>> for ErrorCause<C, S>

Source§

fn from(e: ConversionError<C, S>) -> Self

Converts to this type from the input type.
Source§

impl<C: CustomTypes<S>, S: System<C>> From<FromJsonError> for ErrorCause<C, S>

Source§

fn from(error: FromJsonError) -> Self

Converts to this type from the input type.
Source§

impl<C: CustomTypes<S>, S: System<C>> From<FromNetsBloxJsonError> for ErrorCause<C, S>

Source§

fn from(error: FromNetsBloxJsonError) -> Self

Converts to this type from the input type.
Source§

impl<C: CustomTypes<S>, S: System<C>> From<IntoJsonError<C, S>> for ErrorCause<C, S>

Source§

fn from(error: IntoJsonError<C, S>) -> Self

Converts to this type from the input type.
Source§

impl<C: CustomTypes<S>, S: System<C>> From<NumberError> for ErrorCause<C, S>

Source§

fn from(error: NumberError) -> Self

Converts to this type from the input type.
Source§

impl<C: CustomTypes<S>, S: System<C>> From<ToSimpleError<C, S>> for ErrorCause<C, S>

Source§

fn from(error: ToSimpleError<C, S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<C, S> Freeze for ErrorCause<C, S>
where <<C as CustomTypes<S>>::NativeValue as GetType>::Output: Freeze,

§

impl<C, S> RefUnwindSafe for ErrorCause<C, S>

§

impl<C, S> Send for ErrorCause<C, S>
where <<C as CustomTypes<S>>::NativeValue as GetType>::Output: Send,

§

impl<C, S> Sync for ErrorCause<C, S>
where <<C as CustomTypes<S>>::NativeValue as GetType>::Output: Sync,

§

impl<C, S> Unpin for ErrorCause<C, S>
where <<C as CustomTypes<S>>::NativeValue as GetType>::Output: Unpin,

§

impl<C, S> UnwindSafe for ErrorCause<C, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,