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.

Type parameters

  • T: number = number

Hierarchy

Implements

Index

Constructors

  • Creates a new HTTP error. Subclasses should call this with their fixed status code.

    Type parameters

    • T: number = number

    Parameters

    • statusCode: T

      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<T>

Properties

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

Type declaration

stackTraceLimit: number

Methods

  • generateMetadata(subject: string | Quad_Subject): Quad[]
  • Returns quads representing metadata relevant to this error.

    Parameters

    • subject: string | Quad_Subject

    Returns Quad[]

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

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

  • isInstance(error: any): error is HttpError<number>