Skip to content

Commit

Permalink
caolan#244 catch async exceptions and log their stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunong Xiao committed Jan 29, 2014
1 parent 92a904b commit 4b1bf5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ exports.createTracker = function (on_exit) {
}
};

process.on('uncaughtException', function (err) {
console.error(err.stack);
process.exit(1);
});

process.on('exit', function() {
on_exit = on_exit || exports.default_on_exit;
on_exit(tracker);
Expand Down

0 comments on commit 4b1bf5e

Please sign in to comment.