x/oak/middleware/serve.ts

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Latest
method ServeContext.prototype.throw
import { ServeContext } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v17.1.3/middleware/serve.ts?p=prototype.throw&s=ServeContext";

Create and throw an HTTP Error, which can be used to pass status information which can be caught by other middleware to send more meaningful error messages back to the client. The passed error status will be set on the .response.status by default as well.

Parameters

errorStatus: ErrorStatus[src]
optional
message: string
[src]
optional
props: Record<string, unknown>
[src]