Custom exceptions

Is it possible to create custom exceptions. A custom exception is a custom type:

  1. type
  2. LoadError* = object of Exception

Ending the custom exception’s name with Error is recommended.

Custom exceptions can be raised like any others, e.g.:

  1. raise newException(LoadError, "Failed to load data")