mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
API.stream - catch more errors
This commit is contained in:
parent
13b0d2afa3
commit
0b325b2b7d
@ -126,7 +126,9 @@ def _handle_get_api_stream(handler, path_match, data):
|
|||||||
wfile.write(msg.encode("UTF-8"))
|
wfile.write(msg.encode("UTF-8"))
|
||||||
wfile.flush()
|
wfile.flush()
|
||||||
handler.server.sessions.extend_validation(session_id)
|
handler.server.sessions.extend_validation(session_id)
|
||||||
except IOError:
|
except (IOError, ValueError):
|
||||||
|
# IOError: socket errors
|
||||||
|
# ValueError: raised when 'I/O operation on closed file'
|
||||||
block.set()
|
block.set()
|
||||||
|
|
||||||
def forward_events(event):
|
def forward_events(event):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user