Merge pull request #37 from moonpyk/master

Making use of console.error
This commit is contained in:
Julien Fontanet 2015-05-15 11:24:32 +02:00
commit 62046eb482

View File

@ -342,11 +342,11 @@ function getErrorSource(error) {
// Mimic node's stack trace printing when an exception escapes the process
function handleUncaughtExceptions(error) {
if (!error || !error.stack) {
console.log('Uncaught exception:', error);
console.error('Uncaught exception:', error);
} else {
var source = getErrorSource(error);
if (source !== null) console.log(source);
console.log(error.stack);
if (source !== null) console.error(source);
console.error(error.stack);
}
process.exit(1);
}