Don't log error when websocket is closed

This will stop showing up in Sentry now.
This commit is contained in:
Radon Rosborough 2021-08-26 18:39:49 -07:00
parent 339936c5ee
commit d3ab5d6336
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}