From 508d0459a7c188e87176e0ad57bed5d168e11050 Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Mon, 25 Jun 2018 10:03:39 -0700 Subject: [PATCH] Fix #14919. Should throw exception when camera stream closed by frontend (#15028) * Fix #14919. Should throw exception when camera stream closed by frontend * Re-trigger CI * pythonic re-raise --- homeassistant/components/camera/__init__.py | 1 + homeassistant/components/camera/proxy.py | 1 + 2 files changed, 2 insertions(+) diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index ebda09de20cd35..14550dab899d34 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -322,6 +322,7 @@ async def write_to_mjpeg_stream(img_bytes): except asyncio.CancelledError: _LOGGER.debug("Stream closed by frontend.") response = None + raise finally: if response is not None: diff --git a/homeassistant/components/camera/proxy.py b/homeassistant/components/camera/proxy.py index 1984c21fadbb77..447f4e1e56a7b0 100644 --- a/homeassistant/components/camera/proxy.py +++ b/homeassistant/components/camera/proxy.py @@ -233,6 +233,7 @@ async def write(img_bytes): _LOGGER.debug("Stream closed by frontend.") req.close() response = None + raise finally: if response is not None: