Skip to content

Commit 6551919

Browse files
authored
fix: missing error handler (#3859)
1 parent a427e4b commit 6551919

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/dispatcher/client-h1.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,19 @@ async function connectH1 (client, socket) {
769769
client[kSocket] = socket
770770

771771
if (!llhttpInstance) {
772+
const noop = () => {}
773+
socket.on('error', noop)
772774
llhttpInstance = await llhttpPromise
773775
llhttpPromise = null
776+
socket.off('error', noop)
777+
}
778+
779+
if (socket.errored) {
780+
throw socket.errored
781+
}
782+
783+
if (socket.destroyed) {
784+
throw new SocketError('destroyed')
774785
}
775786

776787
socket[kNoRef] = false

0 commit comments

Comments
 (0)