| 97 | }); |
| 98 | |
| 99 | function test5() { |
| 100 | // This test creates two nested domains: d7 and d8. d8 _does_ register an |
| 101 | // error handler, so throwing within that domain should not emit an uncaught |
| 102 | // exception. |
| 103 | const d7 = domain.create(); |
| 104 | const d8 = domain.create(); |
| 105 | |
| 106 | d8.on('error', function onErrorInD3Domain() { |
| 107 | process.send('errorHandledByDomain'); |
| 108 | }); |
| 109 | |
| 110 | d7.run(function() { |
| 111 | d8.run(function() { |
| 112 | throw new Error('boom!'); |
| 113 | }); |
| 114 | }); |
| 115 | } |
| 116 | tests.push({ |
| 117 | fn: test5, |
| 118 | expectedMessages: ['errorHandledByDomain'] |