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

std/http/mod.ts>createHttpError

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function createHttpError
import { createHttpError } from "https://deno.land/std@0.190.0/http/mod.ts";

A factory function which provides a way to create errors. It takes up to 3 arguments, the error Status, an message, which defaults to the status text and error options, which incudes the expose property to set the .expose value on the error.

Parameters

optional
status: ErrorStatus = [UNSUPPORTED]
optional
message: string
optional
options: HttpErrorOptions