Module

x/oak/deps.ts>errors

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
variable errors
import { errors } from "https://dotland.deno.dev/x/oak@v12.0.1/deps.ts";

A namespace that contains each error constructor. Each error extends HTTPError and provides .status and .expose properties, where the .status will be an error Status value and .expose indicates if information, like a stack trace, should be shared in the response.

By default, .expose is set to false in server errors, and true for client errors.

Examples

Example 1

import { errors } from "https://deno.land/std@$STD_VERSION/http/http_errors.ts";

throw new errors.InternalServerError("Ooops!");

type

Record<ErrorStatusKeys, HttpError>