mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Don't assume errors have stacks associated with them
This commit is contained in:
parent
f939d52551
commit
e2be5c6383
18
red.js
18
red.js
@ -171,7 +171,11 @@ RED.start().then(function() {
|
||||
util.log('[red] Error: port in use');
|
||||
} else {
|
||||
util.log('[red] Uncaught Exception:');
|
||||
util.log(err.stack);
|
||||
if (err.stack) {
|
||||
util.log(err.stack);
|
||||
} else {
|
||||
util.log(err);
|
||||
}
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
@ -187,13 +191,21 @@ RED.start().then(function() {
|
||||
}
|
||||
}).otherwise(function(err) {
|
||||
util.log("[red] Failed to start server:");
|
||||
util.log(err.stack);
|
||||
if (err.stack) {
|
||||
util.log(err.stack);
|
||||
} else {
|
||||
util.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
process.on('uncaughtException',function(err) {
|
||||
util.log('[red] Uncaught Exception:');
|
||||
util.log(err.stack);
|
||||
if (err.stack) {
|
||||
util.log(err.stack);
|
||||
} else {
|
||||
util.log(err);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user