[]previous and next page

BodyTooLargeError

Thrown while a request body is read when it grows past the limit.

Thrown while a request body is read when it grows past the limit. The handler turns it into a 413 response, whichever route was reading the body.

Import#

ts
import { BodyTooLargeError } from "@shadow-js/dusk/server";

Signature#

ts
class BodyTooLargeError extends HttpError

Members#

Name Type Description
limit readonly limit: number The limit in bytes.

Examples#

ts
try { await request.text(); } catch (error) { if (error instanceof BodyTooLargeError) console.log(error.limit); }