On this page
system/exceptions
Source EditException and effect types used in Nim code.
Types
-
AccessViolationError {....deprecated: "See corresponding Defect".} = AccessViolationDefect
- Source Edit
-
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 -
FloatDivByZeroError {....deprecated: "See corresponding Defect".} = FloatDivByZeroDefect
- 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
Source Edit0.0/0.0
, for example. -
FloatInvalidOpError {....deprecated: "See corresponding Defect".} = FloatInvalidOpDefect
- 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 -
FloatUnderflowError {....deprecated: "See corresponding Defect".} = FloatUnderflowDefect
- 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
-
ObjectAssignmentError {....deprecated: "See corresponding Defect".} = ObjectAssignmentDefect
- 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 -
ObjectConversionError {....deprecated: "See corresponding Defect".} = ObjectConversionDefect
- 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
© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/exceptions.html