sdlog2_dump.py skip unknown message type

This commit is contained in:
Bart Slinger 2017-01-30 14:08:38 +01:00 committed by Beat Küng
parent 80c348d3b0
commit a66a25b884

View File

@ -142,9 +142,13 @@ class SDLog2Parser:
self.__parseMsgDescr()
else:
# parse data message
msg_descr = self.__msg_descrs[msg_type]
msg_descr = self.__msg_descrs.get(msg_type, None)
if msg_descr == None:
raise Exception("Unknown msg type: %i" % msg_type)
if self.__correct_errors:
self.__ptr += 1
continue
else:
raise Exception("Unknown msg type: %i" % msg_type)
msg_length = msg_descr[0]
if self.__bytesLeft() < msg_length:
break