function errorMiddleware
errorMiddleware(
ctx: Context,
next: Next
): Promise<void>

Answers an APIException with its status, code and message. Anything else is logged with its stack and answered with a 500 SERVER_ERROR whose message gives nothing away.

Parameters

ctx: Context
next: Next

Return Type

Promise<void>

Usage

import { errorMiddleware } from "api/middleware/error.ts";