Exception was created out of a need for a common base class for all Node.js Error objects. This class will allow you to extend and/or augment any Error by simply defining your own properties on the extended class.

NOTE: Do not to include compromising data in the metadata constructor parameter in production environments.

Hierarchy (view full)

Constructors

Properties

cause?: unknown
message: string

Details of the exception.

metadata?: unknown
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void