Commit 36168e9f authored by Nigel Kukard's avatar Nigel Kukard
Browse files

borg: Be more specific about what JSON decoding failed

parent 647391c4
Pipeline #7153 passed with stage
in 46 seconds
......@@ -338,7 +338,7 @@ class BorgBackup: # noqa: R0902 pylint: disable=too-many-instance-attributes
try:
chunk_json = json.loads(chunk)
except json.JSONDecodeError as err:
self.notifiers.warning(f"Failed to decode JSON: {err}\n{chunk}")
self.notifiers.warning(f"Failed to decode JSON output summary: {err}\n{chunk}")
return
# Store stats
stats["duration"] = int(chunk_json["archive"]["duration"])
......@@ -382,7 +382,7 @@ class BorgBackup: # noqa: R0902 pylint: disable=too-many-instance-attributes
# Parse output
self._parse_output_json(json_obj, stats, stats_state)
except json.JSONDecodeError as err:
self.notifiers.warning(f"Failed to decode JSON: {err}\n{line}")
self.notifiers.warning(f"Failed to decode JSON output: {err}\n{line}")
return
def _parse_output_json( # noqa: C901 pylint: disable=too-many-branches,too-many-statements
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment