Skip to main content
Module

x/oak_commons/http_errors.ts

A set of APIs for handling HTTP and HTTPS requests with Deno 🐿️ 🦕
Very Popular
Go to Latest
import * as oakCommons from "https://deno.land/x/oak_commons@0.3.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.

Classes

The base class that all derivative HTTP extend, providing a status and an expose property.

Variables

A map of HttpErrors that are unique instances for each HTTP error status code.

Functions

Create an instance of an HttpError based on the status code provided.

A type guard that determines if the value is an HttpError or not.