From 29c9a667a6a885e2b8b3b099f61f68d987376800 Mon Sep 17 00:00:00 2001 From: LavrovArtem Date: Wed, 31 Oct 2018 18:28:58 +0300 Subject: [PATCH] fix `Error: write ECONNABORTED` (close #1744) --- src/request-pipeline/connection-reset-guard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/request-pipeline/connection-reset-guard.js b/src/request-pipeline/connection-reset-guard.js index 62d23a8eb..ced093ea7 100644 --- a/src/request-pipeline/connection-reset-guard.js +++ b/src/request-pipeline/connection-reset-guard.js @@ -6,7 +6,8 @@ const connectionResetDomain = domain.create(); connectionResetDomain.on('error', err => { // NOTE: The nodejs throw the EPIPE error instead of the ECONNRESET error // when the connection is broken in some cases on MacOS and Linux - if (err.code === 'ECONNRESET' || !os.win && err.code === 'EPIPE') + // https://github.com/nodejs/node/blob/8b4af64f50c5e41ce0155716f294c24ccdecad03/test/parallel/test-http-destroyed-socket-write2.js + if (err.code === 'ECONNRESET' || !os.win && err.code === 'EPIPE' || os.win && err.code === 'ECONNABORTED') return; connectionResetDomain.removeAllListeners('error');