# compiler/errorhandling

Dark Mode

- Index

Search:
Group by:
Source Edit

This module contains support code for new-styled error handling via an `nkError` node kind.

# Imports

ast, renderer, options, types

# Types

    ErrorKind = enum
      RawTypeMismatchError, ExpressionCannotBeCalled, CustomError,
      WrongNumberOfArguments, AmbiguousCall

  expand as you need. Source Edit

# Procs

    proc errorSubNode(n: PNode): PNode {....raises: [], tags: [].}

  Source Edit

    proc errorToString(config: ConfigRef; n: PNode): string {.
        ...raises: [ValueError, Exception, KeyError], tags: [RootEffect, ReadDirEffect].}

  Source Edit

    proc newError(wrongNode: PNode; k: ErrorKind; args: varargs[PNode]): PNode {.
        ...raises: [], tags: [].}

  Source Edit

    proc newError(wrongNode: PNode; msg: string): PNode {....raises: [], tags: [].}

  Source Edit