From 2301c6ec83a75f68bf31a26579eb9d34ae5c2f3f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 10 Feb 2021 18:54:19 -0500 Subject: [PATCH] pad: Don't throw on socket.io error --- CHANGELOG.md | 1 + src/static/js/pad.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c79240e7b..78b933406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ ### Notable fixes * Enter key now stays in focus when inserted at bottom of viewport. +* Suppressed benign socket.io connection errors * Interface no longer loses color variants on disconnect/reconnect event. * Removed npm.load to support npm7. * General code quality is further significantly improved. diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 753ab7d02..55460b3fb 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -271,7 +271,9 @@ const handshake = () => { pad.collabClient.setStateIdle(); pad.collabClient.setIsPendingRevision(true); } - throw new Error(`socket.io connection error: ${JSON.stringify(error)}`); + // Don't throw an exception. Error events do not indicate problems that are not already + // addressed by reconnection logic, so throwing an exception each time there's a socket.io error + // just annoys users and fills logs. }); socket.on('message', (obj) => {