Error handling middleware for koa