Enum ketos::exec::ExecError
[−]
[src]
pub enum ExecError { ArityError { name: Option<Name>, expected: Arity, found: u32, }, CompareNaN, CannotCompare(&'static str), CannotDefine(Name), DivideByZero, DuplicateField(Name), DuplicateKeyword(Name), DuplicateStructDef(Name), FieldError { struct_name: Name, field: Name, }, FieldTypeError { struct_name: Name, field: Name, expected: Name, found: &'static str, value: Option<Value>, }, FormatError { fmt: Box<str>, span: Span, err: FormatError, }, InvalidClosureValue(u32), InvalidConst(u32), InvalidDepth, InvalidJump(u32), InvalidSlice(usize, usize), InvalidStack(u32), InvalidSystemFn(u32), MissingArgCount(Name), MissingField { struct_name: Name, field: Name, }, NameError(Name), NotCharBoundary(usize), OddKeywordParams, OutOfBounds(usize), Overflow, Panic(Option<Value>), StructDefError(Name), TypeError { expected: &'static str, found: &'static str, value: Option<Value>, }, StructMismatch { lhs: Name, rhs: Name, }, TypeMismatch { lhs: &'static str, rhs: &'static str, }, UnexpectedEnd, UnrecognizedKeyword(Name), UnrecognizedOpCode(u8), }
Represents an error generated while executing bytecode.
Variants
ArityError
Error in arity to function call
Fields of ArityError
name: Option<Name> | Name of function, if available |
expected: Arity | Expected count or range of arguments |
found: u32 | Number of arguments present |
CompareNaN
Attempt to compare with a NaN
Float
value.
CannotCompare(&'static str)
Type does not support ordered comparison
CannotDefine(Name)
Attempt to redefine a name in master scope
DivideByZero
Attempt to divide by a number equal to zero.
DuplicateField(Name)
Duplicate field name in struct definition
DuplicateKeyword(Name)
Duplicate keyword argument to function
DuplicateStructDef(Name)
Duplicate struct definition
FieldError
No such field name in struct
Fields of FieldError
struct_name: Name | Name of struct type |
field: Name | Field name |
FieldTypeError
Type error assigning value to field
Fields of FieldTypeError
struct_name: Name | Name of struct type |
field: Name | Name of field |
expected: Name | Expected type name |
found: &'static str | Name of type received |
value: Option<Value> | Value received |
FormatError
Error in format
call
Fields of FormatError
fmt: Box<str> | Supplied format string |
span: Span | Span within format string |
err: FormatError | Formatting error produced |
InvalidClosureValue(u32)
Invalid index into closure values
InvalidConst(u32)
Invalid const index
InvalidDepth
Invalid (zero) depth value to Quote
, Quasiquote
, or Comma
instruction
InvalidJump(u32)
Invalid jump label
InvalidSlice(usize, usize)
Slice indices out of order
InvalidStack(u32)
Invalid stack index
InvalidSystemFn(u32)
Invalid system function
MissingArgCount(Name)
CallSys
instruction for system function which requires argument count
MissingField
Attempt to construct a Struct
without the given field
Fields of MissingField
struct_name: Name | Struct type name |
field: Name | Field name |
NameError(Name)
Attempt to lookup a name that did not exist in scope.
NotCharBoundary(usize)
Attempt to slice a string not along UTF-8 code point boundaries.
OddKeywordParams
Odd number of parameters when keyword-value pairs expected
OutOfBounds(usize)
Attempt to access an element in a list that is out of bounds.
Overflow
Integer overflow during certain arithmetic operations.
Panic(Option<Value>)
Code called panic
StructDefError(Name)
Struct definition not found
TypeError
Operation performed on unexpected type
Fields of TypeError
expected: &'static str | Name of the type expected |
found: &'static str | Name of the type received |
value: Option<Value> | Value received |
StructMismatch
Function received a value of incorrect type
Fields of StructMismatch
lhs: Name | Type of left-hand side value |
rhs: Name | Type of right-hand side value |
TypeMismatch
Attempt to operate on two values of incompatible types
Fields of TypeMismatch
lhs: &'static str | Type of left-hand side value |
rhs: &'static str | Type of right-hand side value |
UnexpectedEnd
Unexpected end in bytecode
UnrecognizedKeyword(Name)
Unrecognized keyword passed to function
UnrecognizedOpCode(u8)
Unrecognized opcode
Methods
impl ExecError
[src]
fn expected(expected: &'static str, v: &Value) -> ExecError
Convenience function to return a TypeError
value when expected
type is expected, but some other type of value is found.
fn expected_field(struct_name: Name,
field: Name,
expected: Name,
v: &Value)
-> ExecError
field: Name,
expected: Name,
v: &Value)
-> ExecError
Convenience function to return a FieldTypeError
value when a struct
field of the incorrect type is received.
Trait Implementations
impl Debug for ExecError
[src]
impl StdError for ExecError
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0
The lower-level cause of this error, if any. Read more
impl Display for ExecError
[src]
impl NameDisplay for ExecError
[src]
fn fmt(&self, names: &NameStore, f: &mut Formatter) -> Result
Writes the value's display representation to the formatter stream.
impl Error for ExecError
[src]
fn custom<T: Display>(msg: T) -> ExecError
Raised when there is general error when deserializing a type. Read more
fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self
Raised when a Deserialize
receives a type different from what it was expecting. Read more
fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self
Raised when a Deserialize
receives a value of the right type but that is wrong for some other reason. Read more
fn invalid_length(len: usize, exp: &Expected) -> Self
Raised when deserializing a sequence or map and the input data contains too many or too few elements. Read more
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a Deserialize
enum type received a variant with an unrecognized name. Read more
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a Deserialize
struct type received a field with an unrecognized name. Read more
fn missing_field(field: &'static str) -> Self
Raised when a Deserialize
struct type expected to receive a required field with a particular name but that field was not present in the input. Read more
fn duplicate_field(field: &'static str) -> Self
Raised when a Deserialize
struct type received more than one of the same field. Read more