Rename log message / handle cancellederror on image proxy (#5331)
This commit is contained in:
parent
85a84549eb
commit
c458ee29f2
4 changed files with 12 additions and 8 deletions
|
@ -175,7 +175,7 @@ class Camera(Entity):
|
|||
yield from asyncio.sleep(.5)
|
||||
|
||||
except asyncio.CancelledError:
|
||||
_LOGGER.debug("Close stream by browser.")
|
||||
_LOGGER.debug("Close stream by frontend.")
|
||||
response = None
|
||||
|
||||
finally:
|
||||
|
@ -249,12 +249,16 @@ class CameraImageView(CameraView):
|
|||
@asyncio.coroutine
|
||||
def handle(self, request, camera):
|
||||
"""Serve camera image."""
|
||||
image = yield from camera.async_camera_image()
|
||||
try:
|
||||
image = yield from camera.async_camera_image()
|
||||
|
||||
if image is None:
|
||||
return web.Response(status=500)
|
||||
if image is None:
|
||||
return web.Response(status=500)
|
||||
|
||||
return web.Response(body=image)
|
||||
return web.Response(body=image)
|
||||
|
||||
except asyncio.CancelledError:
|
||||
_LOGGER.debug("Close stream by frontend.")
|
||||
|
||||
|
||||
class CameraMjpegStream(CameraView):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue