Skip to main content
Module

x/acorn/router.ts>RouterErrorEvent

A focused RESTful server framework for Deno 🌰🦕
Latest
class RouterErrorEvent
extends ErrorEvent
import { RouterErrorEvent } from "https://deno.land/x/acorn@0.5.1/router.ts";

Error events from the router will be of this type, which provides additional context about the error and provides a way to override the default behaviors of the router.

Constructors

new
RouterErrorEvent(eventInitDict: RouterErrorEventInit)

Properties

readonly
request: Request | undefined

The original Request object.

readonly
respondable: boolean

Indicates if the error can be responded to. true indicates that a Response has not been sent to the client yet, while false indicates that a response cannot be sent.

optional
response: Response

To provide a custom response to an error event set a Response to this property and it will be used instead of the built in default.

The .respondable property will indicate if a response to the client is possible or not.

readonly
route: Route | undefined

If the error occurred while processing a route, the Route will be available on this property.