Identify cameras in error logs for generic and mjpeg cameras (#33561)
parent
ae22b5187a
commit
d1c1aa518d
|
@ -132,7 +132,9 @@ class GenericCamera(Camera):
|
|||
)
|
||||
return response.content
|
||||
except requests.exceptions.RequestException as error:
|
||||
_LOGGER.error("Error getting camera image: %s", error)
|
||||
_LOGGER.error(
|
||||
"Error getting new camera image from %s: %s", self._name, error
|
||||
)
|
||||
return self._last_image
|
||||
|
||||
self._last_image = await self.hass.async_add_job(fetch)
|
||||
|
@ -146,10 +148,12 @@ class GenericCamera(Camera):
|
|||
response = await websession.get(url, auth=self._auth)
|
||||
self._last_image = await response.read()
|
||||
except asyncio.TimeoutError:
|
||||
_LOGGER.error("Timeout getting image from: %s", self._name)
|
||||
_LOGGER.error("Timeout getting camera image from %s", self._name)
|
||||
return self._last_image
|
||||
except aiohttp.ClientError as err:
|
||||
_LOGGER.error("Error getting new camera image: %s", err)
|
||||
_LOGGER.error(
|
||||
"Error getting new camera image from %s: %s", self._name, err
|
||||
)
|
||||
return self._last_image
|
||||
|
||||
self._last_url = url
|
||||
|
|
|
@ -122,10 +122,10 @@ class MjpegCamera(Camera):
|
|||
return image
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
_LOGGER.error("Timeout getting camera image")
|
||||
_LOGGER.error("Timeout getting camera image from %s", self._name)
|
||||
|
||||
except aiohttp.ClientError as err:
|
||||
_LOGGER.error("Error getting new camera image: %s", err)
|
||||
_LOGGER.error("Error getting new camera image from %s: %s", self._name, err)
|
||||
|
||||
def camera_image(self):
|
||||
"""Return a still image response from the camera."""
|
||||
|
|
Loading…
Reference in New Issue