The framework's HTTP error type.
Throw an instance directly, or — preferably — construct one via a factory
function from ./exceptions.ts so the status code is correct by
construction:
HttpError(statusCode: number,message: string,details?: Readonly<Record<string, unknown>>,cause?: Error)
Creates a new HttpError.
Prefer the factory functions in exceptions.ts over calling this
constructor directly — they guarantee a correct status code.
Optional structured details; omitted when absent
from(init: HttpErrorInit): HttpError
Creates an HttpError from an HttpErrorInit object.
Convenience overload used by factory functions so they can branch on
optional details/cause once.
details: Readonly<Record<string, unknown>>
Structured details appended to the error body. Omitted entirely when not
supplied (never undefined) so serialization stays clean.
declare suppresses the ES2022 class-field initialization that would
otherwise set this to undefined on every instance — it only exists on
the object when actually assigned by the constructor.
statusCode: number
The HTTP status code this error maps to.