Improve error reporting

This commit is contained in:
Pascal Vizeli 2020-09-05 10:38:07 +00:00
parent 5cab5f0c08
commit a203ed9cc5
3 changed files with 4 additions and 4 deletions

View File

@ -558,7 +558,7 @@ class Addon(AddonModel):
await self.instance.run() await self.instance.run()
except DockerAPIError as err: except DockerAPIError as err:
self.state = AddonState.ERROR self.state = AddonState.ERROR
raise AddonsError(err) from None raise AddonsError(err) from err
else: else:
self.state = AddonState.STARTED self.state = AddonState.STARTED

View File

@ -149,7 +149,7 @@ class DockerAPI:
container.start() container.start()
except (docker.errors.DockerException, requests.RequestException) as err: except (docker.errors.DockerException, requests.RequestException) as err:
_LOGGER.error("Can't start %s: %s", name, err) _LOGGER.error("Can't start %s: %s", name, err)
raise DockerAPIError(err) from None raise DockerAPIError(err) from err
# Update metadata # Update metadata
with suppress(docker.errors.DockerException, requests.RequestException): with suppress(docker.errors.DockerException, requests.RequestException):

View File

@ -308,7 +308,7 @@ class Tasks(CoreSysAttributes):
try: try:
await addon.start() await addon.start()
except AddonsError as err: except AddonsError as err:
_LOGGER.error("Watchdog %s reanimation failed!", addon.slug) _LOGGER.error("Watchdog %s reanimation failed with %s", addon.slug, err)
self.sys_capture_exception(err) self.sys_capture_exception(err)
async def _watchdog_addon_application(self): async def _watchdog_addon_application(self):
@ -338,7 +338,7 @@ class Tasks(CoreSysAttributes):
try: try:
await addon.restart() await addon.restart()
except AddonsError as err: except AddonsError as err:
_LOGGER.error("Watchdog %s reanimation failed!", addon.slug) _LOGGER.error("Watchdog %s reanimation failed with %s", addon.slug, err)
self.sys_capture_exception(err) self.sys_capture_exception(err)
finally: finally:
self._cache[addon.slug] = 0 self._cache[addon.slug] = 0