From d3ab5d6336e39de83444432ebce92745cb3d7921 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Thu, 26 Aug 2021 18:39:49 -0700 Subject: [PATCH] Don't log error when websocket is closed This will stop showing up in Sentry now. --- backend/api.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/api.js b/backend/api.js index 3ccd4cc..0eb1834 100644 --- a/backend/api.js +++ b/backend/api.js @@ -164,6 +164,10 @@ export class Session { } this.ws.send(JSON.stringify(msg)); } catch (err) { + if (this.ws.readyState === WebSocket.CLOSED) { + // User closed their end, no big deal. + return; + } logError(err); await this.teardown(); }