generic camera: improved exception handling (#6158)

Avoid unhandled exception and stack trace when server closes connection by changing from handle ClientDisconnectedError to DisconnectedError. Also added HttpProcessingError, which was missing.
This commit is contained in:
Erik Eriksson 2017-02-22 16:43:52 +01:00 committed by Paulus Schoutsen
parent 896e0476ff
commit 3b693d5e70

View File

@ -118,7 +118,8 @@ class GenericCamera(Camera):
_LOGGER.error('Timeout getting camera image')
return self._last_image
except (aiohttp.errors.ClientError,
aiohttp.errors.ClientDisconnectedError) as err:
aiohttp.errors.DisconnectedError,
aiohttp.errors.HttpProcessingError) as err:
_LOGGER.error('Error getting new camera image: %s', err)
return self._last_image
finally: