Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback

oak_exception

Deno

A global exception filter middleware by oak.

Example

import { anyExceptionFilter } from "https://deno.land/x/oak_exception@v0.0.6/mod.ts";
import { Application } from "https://deno.land/x/oak@v10.0.0/mod.ts";

const app = new Application();
app.use(anyExceptionFilter());

// other middleware

app.use((ctx) => {
  throw new Error("500");
  ctx.response.body = "Hello World!";
});

console.log("app started with: http://localhost");
await app.listen(":80");