Catch ws reset error (#8266)

* Catch ws reset error

* Formatting
This commit is contained in:
Nicolas Mowen 2023-10-22 04:23:31 -06:00 committed by GitHub
parent 9fc93c72a0
commit cb3990a0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,10 @@ class WebSocketClient(Communicator): # type: ignore[misc]
logger.debug(f"payload for {topic} wasn't text. Skipping...")
return
try:
self.websocket_server.manager.broadcast(ws_message)
except ConnectionResetError:
pass
def stop(self) -> None:
self.websocket_server.manager.close_all()