Log an error when there is an exception while parsing a patch

This way we know on which patch we fail (the exception does not
contain that info).
This commit is contained in:
Marco Castelluccio 2020-04-29 12:17:10 +02:00
Родитель a13fdba2cc
Коммит 0304fb291f
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -440,7 +440,12 @@ def transform(hg, repo_dir, commit):
metrics_file_count = 0
patch = hg.export(revs=[commit.node.encode("ascii")], git=True)
patch_data = rs_parsepatch.get_lines(patch)
try:
patch_data = rs_parsepatch.get_lines(patch)
except Exception:
logger.error(f"Exception while analyzing {commit.node}")
raise
for stats in patch_data:
path = stats["filename"]