Exception hierarchy
The exception tree is defined in the system module. Every exception inherits from system.Exception. Exceptions that indicate programming bugs inherit from system.Defect (which is a subtype of Exception) and are strictly speaking not catchable as they can also be mapped to an operation that terminates the whole process. If panics are turned into exceptions, these exceptions inherit from Defect.
Exceptions that indicate any other runtime error that can be caught inherit from system.CatchableError (which is a subtype of Exception).
Exception
|-- CatchableError
| |-- IOError
| | `-- EOFError
| |-- OSError
| |-- ResourceExhaustedError
| `-- ValueError
| `-- KeyError
`-- Defect
|-- AccessViolationDefect
|-- ArithmeticDefect
| |-- DivByZeroDefect
| `-- OverflowDefect
|-- AssertionDefect
|-- DeadThreadDefect
|-- FieldDefect
|-- FloatingPointDefect
| |-- FloatDivByZeroDefect
| |-- FloatInvalidOpDefect
| |-- FloatOverflowDefect
| |-- FloatUnderflowDefect
| `-- InexactDefect
|-- IndexDefect
|-- NilAccessDefect
|-- ObjectAssignmentDefect
|-- ObjectConversionDefect
|-- OutOfMemoryDefect
|-- RangeDefect
|-- ReraiseDefect
`-- StackOverflowDefect
当前内容版权归 nim-lang.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 nim-lang.org .