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 (view full)

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.

    • Optionalmessage: string

      Error message.

    • options: HttpErrorOptions = {}

      Optional options.

    Returns HttpError<T>

Properties

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

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void