Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oak/middleware/serve.ts>ServeContext#throw

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
method ServeContext.prototype.throw
import { ServeContext } from "https://deno.land/x/oak@v14.1.0/middleware/serve.ts";

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
optional
message: string
optional
props: Record<string, unknown>

Returns

never