don't crash when primitive values are thrown
This commit is contained in:
parent
c50758519f
commit
aafee108c4
@ -102,6 +102,10 @@ Error.prepareStackTrace = function(error, stack) {
|
|||||||
|
|
||||||
// Mimic node's stack trace printing when an exception escapes the process
|
// Mimic node's stack trace printing when an exception escapes the process
|
||||||
process.on('uncaughtException', function(error) {
|
process.on('uncaughtException', function(error) {
|
||||||
|
if (!error || !error.stack) {
|
||||||
|
console.log('Uncaught exception:', error);
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
|
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
|
||||||
if (match) {
|
if (match) {
|
||||||
var cache = {};
|
var cache = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user