Skip to content
Snippets Groups Projects
Commit f8e8f8df authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

Merge pull request #40 from p-l-/fix-dispatch-hook-exceptions

Return Raw() when an exception occurs in .dispatch_hook()
parents 208553dd 9cb94c0d
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,12 @@ class Packet_metaclass(type): ...@@ -210,7 +210,12 @@ class Packet_metaclass(type):
def __call__(cls, *args, **kargs): def __call__(cls, *args, **kargs):
if "dispatch_hook" in cls.__dict__: if "dispatch_hook" in cls.__dict__:
cls = cls.dispatch_hook(*args, **kargs) try:
cls = cls.dispatch_hook(*args, **kargs)
except:
if conf.debug_dissector:
raise
cls = Raw
i = cls.__new__(cls, cls.__name__, cls.__bases__, cls.__dict__) i = cls.__new__(cls, cls.__name__, cls.__bases__, cls.__dict__)
i.__init__(*args, **kargs) i.__init__(*args, **kargs)
return i return i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment