import { ServeContext } from "https://deno.land/x/oak@v14.1.0/middleware/serve.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
.
Because of limitation of TypeScript, any assertion type function requires
specific type annotations, so the ServeContext
type should be
used even if it can be inferred from the context.
Parameters
optional
status: ErrorStatusoptional
props: Record<string, unknown> & Omit<HttpErrorOptions, "status">