feat(backups): a better error on failed snapshot retrieval

This commit is contained in:
Houkime 2023-02-22 13:46:28 +00:00
parent cc09e933ed
commit 39a97cf6d8

View file

@ -141,6 +141,8 @@ class ResticBackuper(AbstractBackuper):
def parse_snapshot_output(self, output: str) -> object: def parse_snapshot_output(self, output: str) -> object:
if "[" not in output: if "[" not in output:
raise ValueError("There is no json in the restic snapshot output") raise ValueError(
"There is no json in the restic snapshot output : " + output
)
starting_index = output.find("[") starting_index = output.find("[")
return json.loads(output[starting_index:]) return json.loads(output[starting_index:])