Skip to content

Commit

Permalink
[minor] Catch uncaughtException slightly more intelligently
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Jul 11, 2011
1 parent 4446215 commit a26cf9d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/forever
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ if (!options.sourceDir) {
options.sourceDir = file && file[0] !== '/' ? process.cwd() : '/';
}

process.on('uncaughtException',function(err){
console.dir(arguments)
})

var uid = forever.randomString(24);
options.uid = uid;
options.pidFile = options.pidFile || uid + '.pid';
Expand Down Expand Up @@ -207,6 +203,14 @@ if ((config.root && config.root !== forever.root)) {
forever.log.silly('Loaded forever successfully.');
}

//
// If there is an uncaught exception then log
// it to the default `forever._debug`.
//
process.on('uncaughtException', function (err) {
console.dir(err.stack.split('\n'));
});

//
// If we should debug this forever process then
// configure it to do so.
Expand Down

0 comments on commit a26cf9d

Please sign in to comment.