mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 01:47:47 +00:00
Ignore Exceptions While Parsing Frames (#1235)
This commit is contained in:
@@ -80,11 +80,18 @@ class Sniffer:
|
||||
while self._thread_alive.is_set():
|
||||
data, nodeid = self._transport.recv(self.RECV_BUFFER_SIZE)
|
||||
|
||||
msg = self._message_factory.create(io.BytesIO(data))
|
||||
# Ignore any exceptions
|
||||
try:
|
||||
msg = self._message_factory.create(io.BytesIO(data))
|
||||
|
||||
if msg is not None:
|
||||
self.logger.debug("Received message: {}".format(msg))
|
||||
self._buckets[nodeid].put(msg)
|
||||
if msg is not None:
|
||||
self.logger.debug("Received message: {}".format(msg))
|
||||
self._buckets[nodeid].put(msg)
|
||||
|
||||
except Exception as e:
|
||||
# Just print the exception to the console
|
||||
print("EXCEPTION: %s" % e)
|
||||
pass
|
||||
|
||||
self.logger.debug("Sniffer stopped.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user