Add some extra debug output during a crash

This should be temporary and help with getting the relevant raw item
data to debug and write tests
This commit is contained in:
2023-10-26 16:47:57 +02:00
parent 4da8e096fe
commit dcae63869c

View File

@@ -411,7 +411,13 @@ def parse_items(data: bytes) -> list[Item]:
items: list[Item] = []
while data:
data, item = parse_item(data)
try:
data, item = parse_item(data)
except:
print("parse_item crashed with", data.hex())
if items:
print("previous item was", items[-1].raw_data.hex())
raise
items.append(item)
# TODO: check if num == len(items)