()
| 43 | })); |
| 44 | |
| 45 | function test() { |
| 46 | |
| 47 | d.on('error', common.mustCall((err) => { |
| 48 | assert.strictEqual(err.message, 'should be caught by domain'); |
| 49 | })); |
| 50 | |
| 51 | const req = http.get({ |
| 52 | socketPath: common.PIPE, |
| 53 | headers: { 'Content-Length': '1' }, |
| 54 | method: 'POST', |
| 55 | path: '/' |
| 56 | }); |
| 57 | req.on('response', function(res) { |
| 58 | res.on('end', function() { |
| 59 | res.emit('error', new Error('should be caught by domain')); |
| 60 | }); |
| 61 | res.resume(); |
| 62 | }); |
| 63 | req.end(); |
| 64 | } |