an error handler for koa, hack ctx.onerror