Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ErrorContext

import type { ErrorContext } from "https://raw.githubusercontent.com/worker-tools/router/master/index.ts";
interface ErrorContext extends RouteContext {
error?: unknown;
response: Response;
}

§Extends

§Properties

§
error?: unknown
[src]

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

§
response: Response
[src]

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).