Commit af8a8370 authored by Julien Muchembled's avatar Julien Muchembled

neolog: fix crash on unknown packets

parent 9e543d76
...@@ -119,9 +119,11 @@ class Log(object): ...@@ -119,9 +119,11 @@ class Log(object):
self._reload(date) self._reload(date)
try: try:
p = self.Packets[code] p = self.Packets[code]
msg = p.__name__
except KeyError: except KeyError:
Packets[code] = p = type('UnknownPacket[%u]' % code, (object,), {}) msg = 'UnknownPacket[%u]' % code
msg = ['#0x%04x %-30s %s' % (msg_id, p.__name__, peer)] body = None
msg = ['#0x%04x %-30s %s' % (msg_id, msg, peer)]
if body is not None: if body is not None:
logger = getattr(self, p.handler_method_name, None) logger = getattr(self, p.handler_method_name, None)
if logger or self._decode_all: if logger or self._decode_all:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment