Skip to main content
Module

x/http_error/mod.ts>ErrorResponse

An error class for HTTP requests.
Latest
class ErrorResponse
implements ErrorResponse<T>
import { ErrorResponse } from "https://deno.land/x/http_error@0.7.0/mod.ts";

Converts errors into error responses that the client can convert back into HttpErrors.

Constructors

new
ErrorResponse(error: unknown)

Type Parameters

optional
T extends Record<string, unknown> = Record<string, unknown>

Static Methods

toError<T extends Record<string, unknown> = Record<string, unknown>>(response: ErrorResponse<T>): HttpError<T>
interface ErrorResponse
import { type ErrorResponse } from "https://deno.land/x/http_error@0.7.0/mod.ts";

A format for sharing errors with the browser. With a consistent format for error responses, the client can convert them back into an HttpErrors.

Type Parameters

optional
T extends Record<string, unknown> = Record<string, unknown>