From 22cc80f4bba312701a0f826359227e4d7e47ef11 Mon Sep 17 00:00:00 2001 From: Mondanzo Date: Tue, 6 Aug 2024 20:01:48 +0200 Subject: [PATCH] Updated error handling --- src/protocol/protocol.server.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/protocol/protocol.server.mjs b/src/protocol/protocol.server.mjs index d49832b..7f8601d 100644 --- a/src/protocol/protocol.server.mjs +++ b/src/protocol/protocol.server.mjs @@ -57,6 +57,10 @@ export class ProtocolServer extends events.EventEmitter { }) rl.on('line', line => this.#handleLine(socket, line)) + rl.on('error', err => { + this.detach(socket) + log.error("Socket connection abruptly lost!") + }) this.#readers.set(socket, rl) activeConnectionGauge.inc()