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
Integer arithmetic that would exceed the i64 range.
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].
Implementations§
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more