| 45 | }); |
| 46 | |
| 47 | function test3() { |
| 48 | // This test creates two nested domains: d3 and d4. d4 doesn't register an |
| 49 | // error handler, but d3 does. The error is handled by the d3 domain and thus |
| 50 | // an 'uncaughtException' event should _not_ be emitted. |
| 51 | const d3 = domain.create(); |
| 52 | const d4 = domain.create(); |
| 53 | |
| 54 | d3.on('error', function onErrorInD3Domain() { |
| 55 | process.send('errorHandledByDomain'); |
| 56 | }); |
| 57 | |
| 58 | d3.run(function() { |
| 59 | d4.run(function() { |
| 60 | throw new Error('boom!'); |
| 61 | }); |
| 62 | }); |
| 63 | } |
| 64 | |
| 65 | tests.push({ |
| 66 | fn: test3, |