class RequestBodyTooLargeError
extends Error
Since 0.5.0

Raised when a request body exceeds the configured RuntimeOptions.maxBodyBytes cap.

Branded with a 413 HTTP status hint, so an application running errorHandler answers 413 Content Too Large in its configured format rather than the masked 500 an unbranded throw from this depth would produce. The brand's detail names the limit and never the observed size: the observed size is only ever a lower bound (the read stops at the cap), so reporting it would be misleading.

Constructors

RequestBodyTooLargeError(maxBodyBytes: number)

Builds the refusal for a body that exceeded the configured cap.

Parameters
maxBodyBytes: number

The configured cap that was exceeded

Properties

readonly
maxBodyBytes: number

The configured cap, in bytes.

Usage

import { RequestBodyTooLargeError } from "runtime/src/index.ts";