From aa4f4c8d47df967058760b11bdee1a115f6b437d Mon Sep 17 00:00:00 2001 From: Vighnesh Kadam <50268642+vighnesh-kadam@users.noreply.github.com> Date: Sun, 3 Oct 2021 13:46:49 +0530 Subject: [PATCH] Use new format for logging exceptions - plugins/cli.py (#3188) --- supervisor/plugins/cli.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/supervisor/plugins/cli.py b/supervisor/plugins/cli.py index fcf17d32b..58287eefa 100644 --- a/supervisor/plugins/cli.py +++ b/supervisor/plugins/cli.py @@ -102,8 +102,7 @@ class PluginCli(PluginBase): try: await self.instance.update(version, image=self.sys_updater.image_cli) except DockerError as err: - _LOGGER.error("CLI update failed") - raise CliUpdateError() from err + raise CliUpdateError("CLI update failed", _LOGGER.error) from err else: self.version = version self.image = self.sys_updater.image_cli @@ -127,8 +126,7 @@ class PluginCli(PluginBase): try: await self.instance.run() except DockerError as err: - _LOGGER.error("Can't start cli plugin") - raise CliError() from err + raise CliError("Can't start cli plugin", _LOGGER.error) from err async def stop(self) -> None: """Stop cli.""" @@ -136,8 +134,7 @@ class PluginCli(PluginBase): try: await self.instance.stop() except DockerError as err: - _LOGGER.error("Can't stop cli plugin") - raise CliError() from err + raise CliError("Can't stop cli plugin", _LOGGER.error) from err async def stats(self) -> DockerStats: """Return stats of cli."""