plugin XEP-0313: log issues in addToHistory instead of raising error

This commit is contained in:
Goffi 2019-07-24 07:51:48 +02:00
commit 633e1eb203

View file

@ -135,7 +135,15 @@ class XEP_0313(object):
continue
# adding message to history
mess_data = client.messageProt.parseMessage(fwd_message_elt)
yield client.messageProt.addToHistory(mess_data)
try:
yield client.messageProt.addToHistory(mess_data)
except exceptions.CancelError as e:
log.warning(
u"message has not been added to history: {e}".format(e=e))
except Exception as e:
log.error(
u"can't add message to history: {e}\n{xml}"
.format(e=e, xml=mess_elt.toXml()))
if not count:
log.info(_(u"We have received no message while offline"))