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: try:
await self.instance.update(version, image=self.sys_updater.image_cli) await self.instance.update(version, image=self.sys_updater.image_cli)
except DockerError as err: except DockerError as err:
_LOGGER.error("CLI update failed") raise CliUpdateError("CLI update failed", _LOGGER.error) from err
raise CliUpdateError() from err
else: else:
self.version = version self.version = version
self.image = self.sys_updater.image_cli self.image = self.sys_updater.image_cli
@ -127,8 +126,7 @@ class PluginCli(PluginBase):
try: try:
await self.instance.run() await self.instance.run()
except DockerError as err: except DockerError as err:
_LOGGER.error("Can't start cli plugin") raise CliError("Can't start cli plugin", _LOGGER.error) from err
raise CliError() from err
async def stop(self) -> None: async def stop(self) -> None:
"""Stop cli.""" """Stop cli."""
@ -136,8 +134,7 @@ class PluginCli(PluginBase):
try: try:
await self.instance.stop() await self.instance.stop()
except DockerError as err: except DockerError as err:
_LOGGER.error("Can't stop cli plugin") raise CliError("Can't stop cli plugin", _LOGGER.error) from err
raise CliError() from err
async def stats(self) -> DockerStats: async def stats(self) -> DockerStats:
"""Return stats of cli.""" """Return stats of cli."""