Sha256: e4540eb059f96ed7fa47de85e82b2e9de7f82bc5c946f91fd5573366f1824634

Contents?: true

Size: 617 Bytes

Versions: 3

Compression:

Stored size: 617 Bytes

Contents

common = require("../common");
assert = common.assert

var MESSAGE = 'catch me if you can';
var caughtException = false;

process.addListener('uncaughtException', function (e) {
  console.log("uncaught exception! 1");
  assert.equal(MESSAGE, e.message);
  caughtException = true;
});

process.addListener('uncaughtException', function (e) {
  console.log("uncaught exception! 2");
  assert.equal(MESSAGE, e.message);
  caughtException = true;
});

setTimeout(function() {
  throw new Error(MESSAGE);
}, 10);

process.addListener("exit", function () {
  console.log("exit");
  assert.equal(true, caughtException);
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rednode-0.1.2 ext/node/test/simple/test-exception-handler.js
rednode-0.1.1 ext/node/test/simple/test-exception-handler.js
rednode-0.1.0 ext/node/test/simple/test-exception-handler.js