module error - jeffmanzione/zinnia GitHub Wiki

module error

Classes

class Error

Represents a run-time error: an unexpected program state that can be caught programmatically with a try {} catch e {} clause.

  • Error(msg): Creates a new Error with message [msg].

Examples

Example 1: Raising an error.

if ~x {
  raise error.Error('Very important x is unexpectedly None.')
}

Example 2: Catching and handling an error.

try {
  None.xyz
catch e {
   io.println('Haha, None has no members!')
}