# HG changeset patch # User Mads Kiilerich # Date 2020-11-14 15:18:05 # Node ID 817dcce30d67c026e144df58fc47372d44c10dfa # Parent c3b6ad713a0fac8a7a26f7337b4c09763d29b8f2 diff: slightly better error message for "diff not recognized as valid" diff --git a/kallithea/lib/diffs.py b/kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py +++ b/kallithea/lib/diffs.py @@ -567,7 +567,7 @@ def _get_header(vcs, diff_chunk): elif vcs == 'hg': match = _hg_header_re.match(diff_chunk) if match is None: - raise Exception('diff not recognized as valid %s diff' % vcs) + raise Exception('diff not recognized as valid %s diff: %r' % (vcs, safe_str(bytes(diff_chunk[:1000])))) meta_info = {k: None if v is None else safe_str(v) for k, v in match.groupdict().items()} rest = diff_chunk[match.end():] if rest: