From de8cfa7acaa61a17a6df5382ba4260c2bd3a5c38 Mon Sep 17 00:00:00 2001 From: Mike van Rossum Date: Mon, 20 Aug 2018 14:37:57 +0800 Subject: [PATCH] catch remaining individual socket errors --- web/server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/server.js b/web/server.js index 6c98eaada..140b3e193 100644 --- a/web/server.js +++ b/web/server.js @@ -26,8 +26,12 @@ wss.on('connection', ws => { ws.isAlive = true; }); ws.ping(_.noop); + ws.on('error', e => { + console.error(new Date, '[WS] connection error:', e); + }); }); + setInterval(() => { wss.clients.forEach(ws => { if(!ws.isAlive) {