wonder-stuff
    Preparing search index...

    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 (View Summary)

    Index

    Constructors

    • Creates an instance of KindError.

      Parameters

      • message: string

        The error message.

      • Optionalkind: 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.

      • Optionaloptions: Options = ...

        Options for constructing the error.

        • cause

          The error that caused this error.

        • metadata

          The metadata to attach to the error.

        • prefix

          A prefix to prepend the name of the error.

        • name

          The name of the error.

      Returns KindError

    Properties

    cause: Error | null | undefined
    kind: string
    message: string
    metadata: Readonly<Metadata> | null | undefined
    name: string
    originalMessage: 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