From 6e1c6975a7d545a722b4d41b23ff5199f479ab0a Mon Sep 17 00:00:00 2001 From: rickyes <0x19951125@gmail.com> Date: Wed, 28 Oct 2020 20:44:42 +0800 Subject: [PATCH] fixup! got error event before error callback --- lib/_http_outgoing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 7394cc4a40ec19..a92eaa3293c51c 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -685,10 +685,10 @@ function onError(msg, err, callback) { } function emitErrorNt(msg, err, callback) { - callback(err); if (typeof msg.emit === 'function' && !msg._closed) { msg.emit('error', err); } + callback(err); } function write_(msg, chunk, encoding, callback, fromEnd) {