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

restic-rewrite-api
Houkime 2023-02-22 13:46:28 +00:00
parent c32353fe9b
commit 98e1c9ebaa
1 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,8 @@ class ResticBackuper(AbstractBackuper):
def parse_snapshot_output(self, output: str) -> object:
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("[")
return json.loads(output[starting_index:])