Skip to main content
Module

x/oak_middleware/deps.ts>Context#assert

A collection of middleware to use with oak. 🐿️ 🦕
Latest
method Context.prototype.assert
import { Context } from "https://deno.land/x/oak_middleware@v0.1.0/deps.ts";

Asserts the condition and if the condition fails, creates an HTTP error with the provided status (which defaults to 500). The error status by default will be set on the .response.status.

Parameters

condition: any
optional
errorStatus: ErrorStatus = [UNSUPPORTED]
optional
message: string
optional
props: object

Returns

asserts condition