mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Catch unhandled exception in websocket_api (#42693)
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
349e4a5ac2
commit
51f847c4b8
@ -222,11 +222,11 @@ class WebSocketHandler:
|
||||
self._to_write.put_nowait(None)
|
||||
# Make sure all error messages are written before closing
|
||||
await self._writer_task
|
||||
except asyncio.QueueFull:
|
||||
await wsock.close()
|
||||
except asyncio.QueueFull: # can be raised by put_nowait
|
||||
self._writer_task.cancel()
|
||||
|
||||
await wsock.close()
|
||||
|
||||
finally:
|
||||
if disconnect_warn is None:
|
||||
self._logger.debug("Disconnected")
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user