interface HttpErrorInit
Since 0.1.0

Options accepted by the HttpError constructor.

Extracted as a type so factory functions can accept a consistent object.

Properties

readonly
statusCode: number

HTTP status code (e.g. 404).

readonly
message: string

Human-readable error message.

readonly
optional
details: Readonly<Record<string, unknown>>

Optional structured details attached to the error body.

readonly
optional
cause: Error

Optional underlying cause (forwarded to the ES2022 Error cause chain).

Usage

import { type HttpErrorInit } from "exceptions/src/index.ts";