import * as oakCommons from "https://deno.land/x/oak_commons@0.10.1/http_errors.ts";
A collection of HTTP errors and utilities.
The export errors
contains an individual class that extends
HttpError
which makes handling HTTP errors in a structured way.
The function createHttpError
provides a way to create instances
of errors in a factory pattern.
The function isHttpError
is a type guard that will narrow a value
to an HttpError
instance.
Examples
Classes
The base class that all derivative HTTP extend, providing a |
Variables
A namespace that contains each error constructor. Each error extends
|
Functions
A factory function which provides a way to create errors. It takes up to 3
arguments, the error | |
A type guard that determines if the value is an HttpError or not. |
Interfaces
Options which can be set when initializing an |
Type Aliases
A type alias which is a set of all the string literal names of the error status codes. |