don't crash when primitive values are thrown

master
Evan Wallace 12 years ago
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
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);
if (match) {
var cache = {};

Loading…
Cancel
Save