1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Log json diff line parsing errors. By @real-yfprojects (#1369)

This commit is contained in:
yfprojects 2022-07-03 05:59:33 +00:00 committed by GitHub
parent e53aa966fc
commit 305db92d4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
import json
import logging
import os
import re
@ -14,6 +15,8 @@
uifile = get_asset('UI/diffresult.ui')
DiffResultUI, DiffResultBase = uic.loadUiType(uifile)
logger = logging.getLogger(__name__)
class DiffResult(DiffResultBase, DiffResultUI):
def __init__(self, fs_data, archive_newer, archive_older, json_lines):
@ -123,6 +126,7 @@ def parse_diff_json_lines(diffs):
if not change_type:
# either no changes, or unrecognized change(s)
logger.error(f"Error parsing diff line {json.dumps(item)}")
raise ValueError(f"Unknown change type {change['type']}")
files_with_attributes.append((size, change_type, name, dirpath, file_type))