Skip to content

jiawei397/oak_exception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oak_exception

Deno

A global exception filter middleware by oak.

Example

import { anyExceptionFilter } from "https://deno.land/x/oak_exception@v0.2.1/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");

About

A global exception filter middleware by oak.

Resources

License

Stars

Watchers

Forks

Packages

No packages published