Exception and effect types used in Nim code.
Types
AssertionDefect = object of Defect
-
Raised when assertion is proved wrong.
Usually the result of using the assert() template.
Source Edit DeadThreadDefect = object of Defect
- Raised if it is attempted to send a message to a dead thread. Source Edit
DivByZeroDefect = object of ArithmeticDefect
- Raised for runtime integer divide-by-zero errors. Source Edit
FieldDefect = object of Defect
- Raised if a record field is not accessible because its discriminant's value does not fit. Source Edit
FloatDivByZeroDefect = object of FloatingPointDefect
-
Raised by division by zero.
Divisor is zero and dividend is a finite nonzero number.
Source Edit FloatInexactDefect = object of FloatingPointDefect
-
Raised for inexact results.
The operation produced a result that cannot be represented with infinite precision -- for example: 2.0 / 3.0, log(1.1)
Note: Nim currently does not detect these!
Source Edit FloatInvalidOpDefect = object of FloatingPointDefect
-
Raised by invalid operations according to IEEE.
Raised by 0.0/0.0, for example.
Source Edit FloatOverflowDefect = object of FloatingPointDefect
-
Raised for overflows.
The operation produced a result that exceeds the range of the exponent.
Source Edit FloatUnderflowDefect = object of FloatingPointDefect
-
Raised for underflows.
The operation produced a result that is too small to be represented as a normal number.
Source Edit IOEffect = object of RootEffect
- IO effect. Source Edit
IOError = object of CatchableError
- Raised if an IO error occurred. Source Edit
KeyError = object of ValueError
-
Raised if a key cannot be found in a table.
Mostly used by the tables module, it can also be raised by other collection modules like sets or strtabs.
Source Edit NilAccessDefect = object of Defect
-
Raised on dereferences of nil pointers.
This is only raised if the segfaults module was imported!
Source Edit ObjectAssignmentDefect = object of Defect
- Raised if an object gets assigned to its parent's object. Source Edit
ObjectConversionDefect = object of Defect
- Raised if an object is converted to an incompatible object type. You can use of operator to check if conversion will succeed. Source Edit
OSError = object of CatchableError errorCode*: int32 ## OS-defined error code describing this error.
- Raised if an operating system service failed. Source Edit
OverflowDefect = object of ArithmeticDefect
-
Raised for runtime integer overflows.
This happens for calculations whose results are too large to fit in the provided bits.
Source Edit ResourceExhaustedError = object of CatchableError
- Raised if a resource request could not be fulfilled. Source Edit
StackOverflowDefect = object of Defect
- Raised if the hardware stack used for subroutine calls overflowed. Source Edit
TimeEffect = object of RootEffect
- Time effect. Source Edit
ValueError = object of CatchableError
- Raised for string and object conversion errors. Source Edit