Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTTPError

The base error class. Implements a standard Javascript Error object that can be sent as an HTTP response.

export
class

HTTPError

extends

{Error}

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new HTTPError(code?: number, message?: string): HTTPError
  • Creates an instance of HTTPError.

    memberof

    HTTPError

    Parameters

    • Optional code: number
    • Optional message: string

    Returns HTTPError

Properties

code

code: number = 500

The status code of the response.

memberof

HTTPError

message

message: string = ERRORS.InternalError

The message associated with the response code.

memberof

HTTPError

Static Error

Error: ErrorConstructor

Static message

message: string

Static name

name: string

Static Optional stack

stack: string

Methods

toResponse

  • Returns a response object suitable for serverless.

    memberof

    HTTPError

    Returns Response

Generated using TypeDoc