Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RestError

Hierarchy

Index

Constructors

constructor

  • new RestError(statusCode?: number, message?: string, additionalParams?: {}): RestError
  • An Error that will be caught and turned into a JSON rest response.

    Parameters

    • Default value statusCode: number = httpStatusCode.serverError.INTERNAL_SERVER_ERROR

      the HTTP status code to send (defaults to 500)

    • Default value message: string = httpStatusString[statusCode] || statusCode.toString()

      the message for the error (defaults to a description of statusCode)

    • Optional additionalParams: {}

      additional properties to put on the JSON response object

      • [key: string]: any

    Returns RestError

Properties

Optional additionalParams

additionalParams: {}

additional properties to put on the JSON response object

Type declaration

  • [key: string]: any

Readonly isRestError

isRestError: true = true

message

message: string

name

name: string

Optional stack

stack: string

statusCode

statusCode: number

the HTTP status code to send (defaults to 500)

Static Error

Error: ErrorConstructor

Generated using TypeDoc