Options
All
  • Public
  • Public/Protected
  • All
Menu

A class for all errors that could be thrown by Solid. All errors inheriting from this should fix the status code thereby hiding the HTTP internals from other components.

Hierarchy

Index

Constructors

constructor

  • new HttpError(statusCode: number, name: string, message?: string): HttpError
  • Creates a new HTTP error. Subclasses should call this with their fixed status code.

    Parameters

    • statusCode: number

      HTTP status code needed for the HTTP response.

    • name: string

      Error name. Useful for logging and stack tracing.

    • Optional message: string

      Message to be thrown.

    Returns HttpError

Properties

message

message: string

name

name: string

Optional prepareStackTrace

prepareStackTrace: (err: Error, stackTraces: NodeJS.CallSite[]) => any

Optional override for formatting stack traces

see

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Type declaration

    • (err: Error, stackTraces: NodeJS.CallSite[]): any
    • Parameters

      • err: Error
      • stackTraces: NodeJS.CallSite[]

      Returns any

Optional stack

stack: string

stackTraceLimit

stackTraceLimit: number

Readonly statusCode

statusCode: number

Protected Readonly Static statusCode

statusCode: number

Methods

captureStackTrace

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Static isInstance