mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 11:06:32 +00:00
Output backup log on error (#3722)
* Output backup log on error * Apply suggestions from code review Co-authored-by: Mike Degatano <michael.degatano@gmail.com> Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
This commit is contained in:
parent
8b7aa7640c
commit
389aab8d4a
@ -681,16 +681,18 @@ class Addon(AddonModel):
|
|||||||
try:
|
try:
|
||||||
command_return = await self.instance.run_inside(command)
|
command_return = await self.instance.run_inside(command)
|
||||||
if command_return.exit_code != 0:
|
if command_return.exit_code != 0:
|
||||||
_LOGGER.error(
|
_LOGGER.debug(
|
||||||
"Pre-/Post backup command returned error code: %s",
|
"Pre-/Post backup command failed with: %s", command_return.output
|
||||||
command_return.exit_code,
|
)
|
||||||
|
raise AddonsError(
|
||||||
|
f"Pre-/Post backup command returned error code: {command_return.exit_code}",
|
||||||
|
_LOGGER.error,
|
||||||
)
|
)
|
||||||
raise AddonsError()
|
|
||||||
except DockerError as err:
|
except DockerError as err:
|
||||||
_LOGGER.error(
|
raise AddonsError(
|
||||||
"Failed running pre-/post backup command %s: %s", command, err
|
f"Failed running pre-/post backup command {command}: {str(err)}",
|
||||||
)
|
_LOGGER.error,
|
||||||
raise AddonsError() from err
|
) from err
|
||||||
|
|
||||||
async def backup(self, tar_file: tarfile.TarFile) -> None:
|
async def backup(self, tar_file: tarfile.TarFile) -> None:
|
||||||
"""Backup state of an add-on."""
|
"""Backup state of an add-on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user