pub enum ErrorKind {
TypeError,
DivisionByZero,
Overflow,
IndexOutOfBounds,
KeyError,
ValueError,
IOError,
AttrError,
Bonk,
AssertError,
RecursionLimit,
}Expand description
The category of a runtime error. Each variant maps to a pls/oh no
catchable failure a Doge program can hit.
Variants§
TypeError
An operator or builtin was handed a value of the wrong type.
DivisionByZero
/ or // or % with a zero divisor.
Overflow
A number too large to materialize where a bounded one is unavoidable — a
** exponent too big to compute, or a non-finite Float narrowed to an Int.
Ordinary Int arithmetic is arbitrary precision and never overflows.
IndexOutOfBounds
List/Str index outside the valid range.
KeyError
Dict lookup for a key that is not present.
ValueError
A value was the right type but not a usable value (e.g. int("dog")).
IOError
An I/O or environment operation failed: a file could not be read/written, or held bytes that were not valid text.
AttrError
A missing field or method on an object, or a method call on a value whose type has no methods at all.
Bonk
A bonk raised by the program itself.
AssertError
An amaze assertion whose condition was falsy.
RecursionLimit
A call chain nested past [RECURSION_LIMIT].