Skip to content

Commit

Permalink
Merge pull request FullstackAcademy#37 from FullstackAcademy/better-e…
Browse files Browse the repository at this point in the history
…rror-logs

Log stack trace for server errors
  • Loading branch information
joedotjs committed Nov 9, 2015
2 parents 7316fd5 + 8f5c643 commit 07263b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generated/server/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ app.get('/*', function (req, res) {

// Error catching endware.
app.use(function (err, req, res, next) {
console.error(err, typeof next);
console.error(err)
console.error(err.stack);
res.status(err.status || 500).send(err.message || 'Internal server error.');
});

0 comments on commit 07263b7

Please sign in to comment.