Remove superfluous error messages and handle uncaught exceptions
This commit is contained in:
parent
ef04f49152
commit
ee743ac327
|
@ -262,7 +262,6 @@ class SpectrumBackend:
|
||||||
|
|
||||||
def handleConvMessagePayload(self, data):
|
def handleConvMessagePayload(self, data):
|
||||||
payload = protocol_pb2.ConversationMessage()
|
payload = protocol_pb2.ConversationMessage()
|
||||||
self.logger.error("handleConvMessagePayload")
|
|
||||||
if (payload.ParseFromString(data) == False):
|
if (payload.ParseFromString(data) == False):
|
||||||
#TODO: ERROR
|
#TODO: ERROR
|
||||||
return
|
return
|
||||||
|
|
|
@ -434,10 +434,12 @@ class Session(YowsupApp):
|
||||||
def onPresenceReceived(self, _type, name, jid, lastseen):
|
def onPresenceReceived(self, _type, name, jid, lastseen):
|
||||||
self.logger.info("Presence received: %s %s %s %s", _type, name, jid, lastseen)
|
self.logger.info("Presence received: %s %s %s %s", _type, name, jid, lastseen)
|
||||||
buddy = jid.split("@")[0]
|
buddy = jid.split("@")[0]
|
||||||
try:
|
try:
|
||||||
buddy = self.buddies[buddy]
|
buddy = self.buddies[buddy]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.logger.error("Buddy not found: %s", buddy)
|
# Sometimes whatsapp send our own presence
|
||||||
|
if buddy != self.legacyName:
|
||||||
|
self.logger.error("Buddy not found: %s", buddy)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (lastseen == str(buddy.lastseen)) and (_type == buddy.presence):
|
if (lastseen == str(buddy.lastseen)) and (_type == buddy.presence):
|
||||||
|
|
|
@ -62,7 +62,13 @@ logging.basicConfig( \
|
||||||
|
|
||||||
# Handler
|
# Handler
|
||||||
def handleTransportData(data):
|
def handleTransportData(data):
|
||||||
plugin.handleDataRead(data)
|
try:
|
||||||
|
plugin.handleDataRead(data)
|
||||||
|
except SystemExit as e:
|
||||||
|
raise e
|
||||||
|
except:
|
||||||
|
logger = logging.getLogger('transwhat')
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
e4u.load()
|
e4u.load()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue