From 2e0619fbbabbc01c5f39fc8c6acc98613740894d Mon Sep 17 00:00:00 2001 From: RobinLinus Date: Thu, 13 Oct 2022 15:20:38 +0200 Subject: [PATCH] Add error handler to ws connection --- server/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index 38fa399..c47feb1 100644 --- a/server/index.js +++ b/server/index.js @@ -30,6 +30,7 @@ class SnapdropServer { _onConnection(peer) { this._joinRoom(peer); peer.socket.on('message', message => this._onMessage(peer, message)); + peer.socket.on('error', console.error); this._keepAlive(peer); // send displayName @@ -288,4 +289,4 @@ Object.defineProperty(String.prototype, 'hashCode', { } }); -const server = new SnapdropServer(process.env.PORT || 3000); \ No newline at end of file +const server = new SnapdropServer(process.env.PORT || 3000);