An error class that has an associated HTTP status.

When thrown inside the request lifecycle, this will result in the HTTP status code being applied to the response.

Hierarchy

Constructors

Properties

cause?: unknown
context: {
    [key: string]: any;
} = {}

Type declaration

  • [key: string]: any
message: string = ''
name: string
originalError?: Error
stack?: string
status: HTTPStatus = 500
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void