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 extends number = number

Hierarchy

Implements

Constructors

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

    Type Parameters

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

  • Returns quads representing metadata relevant to this error.

    Parameters

    • subject: string | Quad_Subject

    Returns Quad[]

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void