mirror of https://github.com/lukechilds/node.git
Browse Source
req.socket._hadError should be set before emitting the error event. PR-URL: https://github.com/nodejs/node/pull/14659 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>canary-base
committed by
Tobias Nießen
2 changed files with 20 additions and 4 deletions
@ -0,0 +1,16 @@ |
|||
'use strict'; |
|||
const assert = require('assert'); |
|||
const http = require('http'); |
|||
const common = require('../common'); |
|||
|
|||
// not exists host
|
|||
const host = '*'.repeat(256); |
|||
const req = http.get({ host }); |
|||
const err = new Error('mock unexpected code error'); |
|||
req.on('error', common.mustCall(() => { |
|||
throw err; |
|||
})); |
|||
|
|||
process.on('uncaughtException', common.mustCall((e) => { |
|||
assert.strictEqual(e, err); |
|||
})); |
Loading…
Reference in new issue