Class HttpError<T>

Throw this error to return an HTTP error response.

Warning

This error should is caught by the framework and sent as an HTTP response. The message therefore should not contain any sensitive information!

Type Parameters

  • T extends number = number

Hierarchy

  • Error
    • HttpError

Constructors

Properties

message: string
name: string
stack?: string
status: T
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Methods

  • Get a json representation of the error.

    Returns {
        message: string;
        status: T;
    }

    the json representation of the error

    • message: string
    • status: T
  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc