You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
600 B

var common = require('../common');
var assert = require('assert');
var MESSAGE = 'catch me if you can';
var caughtException = false;
process.on('uncaughtException', function(e) {
console.log('uncaught exception! 1');
assert.equal(MESSAGE, e.message);
caughtException = true;
});
process.on('uncaughtException', function(e) {
console.log('uncaught exception! 2');
assert.equal(MESSAGE, e.message);
caughtException = true;
});
setTimeout(function() {
throw new Error(MESSAGE);
}, 10);
process.on('exit', function() {
console.log('exit');
assert.equal(true, caughtException);
});