diff --git a/lib/dispatcher/client-h1.js b/lib/dispatcher/client-h1.js index 5018108d636..85732233938 100644 --- a/lib/dispatcher/client-h1.js +++ b/lib/dispatcher/client-h1.js @@ -769,8 +769,15 @@ async function connectH1 (client, socket) { client[kSocket] = socket if (!llhttpInstance) { + const noop = () => {} + socket.on('error', noop) llhttpInstance = await llhttpPromise llhttpPromise = null + socket.off('error', noop) + + if (socket.errored) { + throw socket.errored + } } socket[kNoRef] = false