Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fsrouter/deps.ts>http.errors

A file system based router for Deno.
Latest
variable http.errors
import { http } from "https://deno.land/x/fsrouter@3.1.0/deps.ts";
const { errors } = http;

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@0.224.0/http/http_errors.ts";

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

type

Record<ErrorStatusKeys, HttpError>