Added try statements for various callbacks

This commit is contained in:
Mark Qvist 2021-10-15 14:36:50 +02:00
parent f7e8fc4719
commit 448ea8ceb5
5 changed files with 93 additions and 29 deletions

View file

@ -263,7 +263,11 @@ class Destination:
if plaintext != None:
if packet.packet_type == RNS.Packet.DATA:
if self.callbacks.packet != None:
self.callbacks.packet(plaintext, packet)
try:
self.callbacks.packet(plaintext, packet)
except Exception as e:
RNS.log("Error while executing receive callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def incoming_link_request(self, data, packet):
link = RNS.Link.validate_request(self, data, packet)