Use new format for logging exceptions - plugins/cli.py (#3188)

This commit is contained in:
Vighnesh Kadam 2021-10-03 13:46:49 +05:30 committed by GitHub
parent b83da5d89f
commit aa4f4c8d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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."""