Guest User

Untitled

a guest
Dec 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. app.use(async (ctx, next) => {
  2. try {
  3. await next();
  4. }
  5. catch (error) {
  6. console.log(error);
  7. }
  8. });
  9.  
  10. app.use(bodyParser());
  11.  
  12. const router = new KoaRouter();
  13.  
  14. router.get('/', () => throw new Error('test'));
  15.  
  16. app.use(router.routes());
Add Comment
Please, Sign In to add comment