An error to describe detailed states and relationships.

This error type supports error taxonomies and attachment of metadata, as well as causal relationships between itself and another source error. More specific variations can be built off this to provide a payload for logging setups like Sentry or winston.

Hierarchy

Constructors

  • Creates an instance of KindError.

    Parameters

    • message: string

      The error message.

    • Optional kind: string = Errors.Unknown

      The kind of error. This will be combined with prefix to form the name of the error, i.e. PrefixKindError. Defaults to Errors.Unknown.

    • Optional options: Options = ...

      Options for constructing the error.

    Returns KindError

    Memberof

    KindError

Properties

cause: undefined | null | Error
kind: string
message: string
metadata: undefined | null | Readonly<Metadata>
name: string
originalMessage: string
originalStack: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc