Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an error that was caused by another error.

Hierarchy

  • Error
    • ErrorWithCause

Index

Constructors

constructor

  • Create an instance of ErrorWithCause.

    Parameters

    • message: string

      Error message.

    • cause: Error

      Original error, causing this error.

    Returns ErrorWithCause

Properties

Readonly cause

cause: Error

message

message: string

name

name: string

Optional prepareStackTrace

prepareStackTrace: undefined | ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

see

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Optional stack

stack: undefined | string

stackTraceLimit

stackTraceLimit: number

Accessors

rootCause

  • get rootCause(): Error
  • Root cause of the error. If there are multiple errors caused one by another, the root cause is the first error that occurred. In case there is no root cause.

    Returns Error

Methods

captureStackTrace

  • captureStackTrace(targetObject: Object, constructorOpt?: Function): void
  • Create .stack property on a target object

    Parameters

    • targetObject: Object
    • Optional constructorOpt: Function

    Returns void