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

  • 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

cause?: unknown
details?: Dict<unknown>
errorCode: string
message: string
name: string
stack?: string
statusCode: number
prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

Type declaration

stackTraceLimit: number
statusCode: number

Methods

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

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void