commit
62046eb482
@ -342,11 +342,11 @@ function getErrorSource(error) {
|
|||||||
// Mimic node's stack trace printing when an exception escapes the process
|
// Mimic node's stack trace printing when an exception escapes the process
|
||||||
function handleUncaughtExceptions(error) {
|
function handleUncaughtExceptions(error) {
|
||||||
if (!error || !error.stack) {
|
if (!error || !error.stack) {
|
||||||
console.log('Uncaught exception:', error);
|
console.error('Uncaught exception:', error);
|
||||||
} else {
|
} else {
|
||||||
var source = getErrorSource(error);
|
var source = getErrorSource(error);
|
||||||
if (source !== null) console.log(source);
|
if (source !== null) console.error(source);
|
||||||
console.log(error.stack);
|
console.error(error.stack);
|
||||||
}
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user