Enum brane_exe::errors::VmError

source ·
pub enum VmError {
Show 32 variants GlobalStateError { err: Box<dyn Send + Sync + Error>, }, UnknownFunction { func: FunctionId, }, PcOutOfBounds { func: FunctionId, edges: usize, got: usize, }, EmptyStackError { pc: ProgramCounter, instr: Option<usize>, expected: DataType, }, StackTypeError { pc: ProgramCounter, instr: Option<usize>, got: DataType, expected: DataType, }, StackLhsRhsTypeError { pc: ProgramCounter, instr: usize, got: (DataType, DataType), expected: DataType, }, ArrayTypeError { pc: ProgramCounter, instr: usize, got: DataType, expected: DataType, }, InstanceTypeError { pc: ProgramCounter, instr: usize, class: String, field: String, got: DataType, expected: DataType, }, CastError { pc: ProgramCounter, instr: usize, err: ValueError, }, ArrIdxOutOfBoundsError { pc: ProgramCounter, instr: usize, got: i64, max: usize, }, ProjUnknownFieldError { pc: ProgramCounter, instr: usize, class: String, field: String, }, VarDecError { pc: ProgramCounter, instr: usize, err: FrameStackError, }, VarUndecError { pc: ProgramCounter, instr: usize, err: FrameStackError, }, VarGetError { pc: ProgramCounter, instr: usize, err: FrameStackError, }, VarSetError { pc: ProgramCounter, instr: usize, err: FrameStackError, }, SpawnError { pc: ProgramCounter, err: JoinError, }, BranchTypeError { pc: ProgramCounter, branch: usize, got: DataType, expected: DataType, }, IllegalBranchType { pc: ProgramCounter, branch: usize, merge: MergeStrategy, got: DataType, expected: DataType, }, FunctionTypeError { pc: ProgramCounter, name: String, arg: usize, got: DataType, expected: DataType, }, UnresolvedLocation { pc: ProgramCounter, name: String, }, UnknownInput { pc: ProgramCounter, task: String, name: DataName, }, UnplannedInput { pc: ProgramCounter, task: String, name: DataName, }, FrameStackPushError { pc: ProgramCounter, err: FrameStackError, }, FrameStackPopError { pc: ProgramCounter, err: FrameStackError, }, ReturnTypeError { pc: ProgramCounter, got: DataType, expected: DataType, }, TaskTypeError { pc: ProgramCounter, name: String, arg: usize, got: DataType, expected: DataType, }, UnknownData { pc: ProgramCounter, name: String, }, UnknownResult { pc: ProgramCounter, name: String, }, UnknownPackage { pc: ProgramCounter, name: String, version: Version, }, ArgumentsSerializeError { pc: ProgramCounter, err: Error, }, StackError { pc: ProgramCounter, instr: Option<usize>, err: StackError, }, Custom { pc: ProgramCounter, err: Box<dyn Send + Sync + Error>, },
}
Expand description

Defines errors that relate to a VM’s execution.

Variants§

§

GlobalStateError

An error occurred while instantiating the custom state.

Fields

§err: Box<dyn Send + Sync + Error>
§

UnknownFunction

The given function pointer was out-of-bounds for the given workflow.

Fields

§

PcOutOfBounds

The given program counter was out-of-bounds for the given function.

Fields

§edges: usize
§got: usize
§

EmptyStackError

We expected there to be a value on the stack but there wasn’t.

Fields

§instr: Option<usize>
§expected: DataType
§

StackTypeError

The value on top of the stack was of unexpected data type.

Fields

§instr: Option<usize>
§expected: DataType
§

StackLhsRhsTypeError

The two values on top of the stack (in a lefthand-side, righthand-side fashion) are of incorrect data types.

Fields

§instr: usize
§expected: DataType
§

ArrayTypeError

A value in an Array was incorrectly typed.

Fields

§instr: usize
§expected: DataType
§

InstanceTypeError

A value in an Instance was incorrectly typed.

Fields

§instr: usize
§class: String
§field: String
§expected: DataType
§

CastError

Failed to perform a cast instruction.

§

ArrIdxOutOfBoundsError

The given integer was out-of-bounds for an array with given length.

Fields

§instr: usize
§got: i64
§max: usize
§

ProjUnknownFieldError

The given field was not present in the given class

Fields

§instr: usize
§class: String
§field: String
§

VarDecError

Could not declare the variable.

§

VarUndecError

Could not un-declare the variable.

§

VarGetError

Could not get the value of a variable.

§

VarSetError

Could not set the value of a variable.

§

SpawnError

Failed to spawn a new thread.

§

BranchTypeError

One of the branches of a parallel returned an invalid type.

Fields

§branch: usize
§expected: DataType
§

IllegalBranchType

The branch’ type does not match that of the current merge strategy at all

Fields

§branch: usize
§expected: DataType
§

FunctionTypeError

One of a function’s arguments was of an incorrect type.

Fields

§name: String
§arg: usize
§expected: DataType
§

UnresolvedLocation

We got told to run a function but do not know where.

Fields

§name: String
§

UnknownInput

The given input (dataset, result) was not there as possible option for the given task.

§

UnplannedInput

The given input (dataset, result) was not yet planned at the time of execution.

§

FrameStackPushError

Attempted to call a function but the framestack thought otherwise.

§

FrameStackPopError

Attempted to call a function but the framestack was empty.

§

ReturnTypeError

The return type of a function was not correct

Fields

§expected: DataType
§

TaskTypeError

There was a type mismatch in a task call.

Fields

§name: String
§arg: usize
§expected: DataType
§

UnknownData

A given asset was not found at all.

Fields

§name: String
§

UnknownResult

A given intermediate result was not found at all.

Fields

§name: String
§

UnknownPackage

The given package was not known.

Fields

§name: String
§version: Version
§

ArgumentsSerializeError

Failed to serialize the given argument list.

§

StackError

An error that relates to the stack.

§

Custom

A Vm-defined error.

Fields

§err: Box<dyn Send + Sync + Error>

Implementations§

source§

impl VmError

source

pub fn prettyprint(&self)

Prints the VM error neatly to stderr.

Trait Implementations§

source§

impl Debug for VmError

source§

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

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

impl Display for VmError

source§

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

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

impl Error for VmError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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,

source§

impl<T> MaybeSendSync for T