mirror of
https://github.com/borgbase/vorta
synced 2025-03-11 06:33:46 +00:00
Raise ValueError
in case of unknown change type in diff json. By @real-yfprojects (#1350)
Currently an assert statement checks whether a change type was recognized. This assert statement won't give any information on the actual change type that is not implemented. Now a ValueError that mentiones the unknown change type in its message will be raised instead. * src/vorta/views/diff_result.py (parse_diff_json_lines): Replace assert statement by if and raise statements. Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
This commit is contained in:
parent
492a3128f8
commit
091c0dcacd
1 changed files with 4 additions and 1 deletions
|
@ -120,7 +120,10 @@ def parse_diff_json_lines(diffs):
|
|||
# change['new_user'], change['new_group'])
|
||||
change_type = 'modified'
|
||||
change_type_priority = 1
|
||||
assert change_type # either no changes, or unrecognized change(s)
|
||||
|
||||
if not change_type:
|
||||
# either no changes, or unrecognized change(s)
|
||||
raise ValueError(f"Unknown change type {change['type']}")
|
||||
|
||||
files_with_attributes.append((size, change_type, name, dirpath, file_type))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue