Navigation Menu

Skip to content

Commit

Permalink
add koa2 error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sangshilong committed Sep 11, 2017
1 parent 3c2a5c7 commit 7b64f54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions templates1/js/app.js
Expand Up @@ -32,4 +32,9 @@ app.use(require('koa-static')(__dirname + '/public'));
app.use(index.routes(), index.allowedMethods());
app.use(users.routes(), users.allowedMethods());

// error-handling
app.on('error', (err, ctx) => {
console.error('server error', err, ctx)
});

module.exports = app;
2 changes: 1 addition & 1 deletion templates2/js/app.js
Expand Up @@ -38,7 +38,7 @@ app.use(users.routes(), users.allowedMethods())

// error-handling
app.on('error', (err, ctx) => {
log.error('server error', err, ctx)
console.error('server error', err, ctx)
});

module.exports = app

0 comments on commit 7b64f54

Please sign in to comment.