Documentation
    Preparing search index...

    Base class for all errors.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a new AbstractError.

      Parameters

      • code: string

        The main identification code for the error.

      • message: string

        The main error message.

      • status: number

        The HTTP status code to return.

      Returns AbstractError

    Properties

    cause?: unknown
    code: string

    An application-unique, readable error code.

    message: string
    name: string
    stack?: string
    status: number

    The HTTP status code to associate with this error.

    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

    • Checks if an object is an instance of AbstractError, or one of its subclasses.

      Parameters

      • error: unknown

        The object to check.

      • allowForeignModule: boolean = true

        Only check for similar looking error codes. You're going to want to use this if you're dealing with a setup where multiple versions of js-utils are loaded.

      Returns error is AbstractError

      true if the object is an AbstractError, false otherwise.