Skip to main content
Module

x/cav/mod.ts>ResolveErrorArg

A server framework for Deno
Go to Latest
interface ResolveErrorArg
import { type ResolveErrorArg } from "https://deno.land/x/cav@0.0.23/mod.ts";

Arguments available to a ResolveError function.

Properties

req: Request

The Request being processed.

res: ResponseInit & { headers: Headers; }

A ResponseInit applied to the Endpoint response after resolving and packing the value to send to the client. The Headers object is always available.

url: URL

new URL(req.url)

conn: http.ConnInfo

Connection information provided by Deno.

path: string

The path that matched the Endpoint's path schema option.

query: Record<string, string | string[]>

The unprocessed query object associated with this request.

groups: Record<string, string | string[]>

The unprocoessed path groups object captured during routing.

error: unknown

The offending error.

asset: (opt: ServeAssetOptions) => Promise<Response>

Returns a Response created using an asset from an assets directory.

redirect: (to: string, status?: number) => Response

Returns a redirect Response. If the redirect path doesn't specify an origin, the origin of the current request is used. If the path starts with a ".", it is joined with the pathname of the Request url to get the final redirect path. The default status is 302.