From 83628b9bf0cf77eb9ae713ae6cac9ac215e0b1fe Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Tue, 7 Jul 2020 20:04:53 +0200 Subject: [PATCH] Emit connection errors as server sessionError --- lib/spdy/server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/spdy/server.js b/lib/spdy/server.js index 1889fcd..bcbd58b 100644 --- a/lib/spdy/server.js +++ b/lib/spdy/server.js @@ -124,11 +124,12 @@ proto._handleConnection = function _handleConnection (socket, protocol) { connection.start(2) } - connection.on('error', function () { + var self = this + connection.on('error', function (error) { + self.emit('sessionError', error, socket) socket.destroy() }) - var self = this connection.on('stream', function (stream) { self._onStream(stream) })