Skip to main content
Module

x/workers_router/index.ts>ErrorContext

A router for Worker Runtimes such and Cloudflare Workers or Service Workers.
Latest
interface ErrorContext
implements RouteContext
import { type ErrorContext } from "https://deno.land/x/workers_router@v0.3.0-pre.6/index.ts";

Properties

response: Response

If the exception is well-known and caused by middleware, this property is populated with a Response object with an appropriate status code and text set.

You can use it to customize the error response, e.g.: new Response('...', response).

optional
error: unknown

If an unknown error occurred, the sibling response property is set to be an "internal server error" while the error property contains thrown error.