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
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
struct_name: Name | Name of struct type |
field: Name | Field name |
FieldTypeError
Type error assigning value to field
Fields
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
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
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
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
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
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
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: Into<String>>(msg: T) -> ExecError
Raised when there is general error when deserializing a type.
fn end_of_stream() -> ExecError
Raised when a Deserialize
type unexpectedly hit the end of the stream.
fn invalid_type(ty: Type) -> Self
Raised when a Deserialize
was passed an incorrect type.
fn invalid_value(msg: &str) -> Self
Raised when a Deserialize
was passed an incorrect value.
fn invalid_length(len: usize) -> Self
Raised when a fixed sized sequence or map was passed in the wrong amount of arguments. Read more
fn unknown_variant(field: &str) -> Self
Raised when a Deserialize
enum type received an unexpected variant.
fn unknown_field(field: &str) -> Self
Raised when a Deserialize
struct type received an unexpected struct field.
fn missing_field(field: &'static str) -> Self
raised when a deserialize
struct type did not receive a field.
fn duplicate_field(field: &'static str) -> Self
Raised when a Deserialize
struct type received more than one of the same struct field. Read more