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

Implements

Index

Constructors

constructor

  • 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

      Error message.

    • options: HttpErrorOptions = {}

      Optional options.

    Returns HttpError

Properties

Optional Readonly cause

cause?: unknown

Optional Readonly details

details?: Dict<unknown>

Readonly errorCode

errorCode: string

message

message: string

name

name: string

Optional stack

stack?: string

Readonly statusCode

statusCode: number

Static stackTraceLimit

stackTraceLimit: number

Static Protected Readonly statusCode

statusCode: number

Methods

Static captureStackTrace

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

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Static isInstance

Static Optional prepareStackTrace

  • prepareStackTrace(err: Error, stackTraces: CallSite[]): any