Represents a custom exception for API-related errors. This class extends the built-in Error class and includes additional functionality for handling HTTP status codes.

ApiException

The error message that describes the exception.

The HTTP status code associated with the error.

Hierarchy

  • Error
    • ApiException

Constructors

Properties

message: string
name: string
stack?: string
status: IStatusCode = STATUS_CODE.INTERNAL
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