Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpError

An error with an attached HTTP status code.

Hierarchy

  • Error
    • HttpError

Index

Constructors

Properties

Accessors

Constructors

constructor

  • new HttpError(error: string | Error, code?: number): HttpError
  • Parameters

    • error: string | Error

      The error object or message.

    • Default value code: number = 500

      The HTTP status code.

    Returns HttpError

Properties

Static Error

Error: ErrorConstructor

Static message

message: string

Static name

name: string

Static Optional stack

stack: string

Accessors

code

  • get code(): number
  • Returns the HTTP status code for the error.

    Returns number