Base class for creating custom errors.

Hierarchy (View Summary)

Constructors

  • Constructs a new ESPBaseError.

    Parameters

    • label: string

      A label representing the error type.

    • code: string

      A key corresponding to a specific error message from the provided error messages object.

    • errorMessages: Record<string, string>

      An object mapping error codes to their corresponding error messages.

    • defaultMessage: string = defaultErrorMessages.UNKNOWN_ERROR

      A default message if the code is not found in the error messages.

    Returns ESPBaseError

Properties

cause?: unknown
code: string

The specific error code associated with the error.

label: string

A label to classify the error type.

message: string
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