Class XtError

Wrap an error as an XtError instance.

Features:

  • Parsed stack trace on 'frames' property.
  • Colorized pretty print for the terminal, incl. any unknown properties, lazily rendered when the 'stack' property is accessed.
  • JSON serialized object with parsed stack trace and other properties, only without the stack trace string.

Hierarchy

Constructors

Properties

cause?: unknown
frames: [string, string][] = []

Parsed stack trace.

message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Methods

  • Renders the error-message, stack-trace and any other own-properties as a colorful formatted string that is easy to read when printed to in the terminal.

    Returns undefined | string

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc