From 373b2009c934511cb17fd0bb544edc9d81028318 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Apr 2019 15:42:10 -0700 Subject: [PATCH] Catch connection reset (#22982) --- homeassistant/components/websocket_api/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/websocket_api/http.py b/homeassistant/components/websocket_api/http.py index 85cb256df90..b51e5d5699d 100644 --- a/homeassistant/components/websocket_api/http.py +++ b/homeassistant/components/websocket_api/http.py @@ -53,7 +53,8 @@ class WebSocketHandler: async def _writer(self): """Write outgoing messages.""" # Exceptions if Socket disconnected or cancelled by connection handler - with suppress(RuntimeError, *CANCELLATION_ERRORS): + with suppress(RuntimeError, ConnectionResetError, + *CANCELLATION_ERRORS): while not self.wsock.closed: message = await self._to_write.get() if message is None: