diff --git a/sat/plugins/plugin_xep_0313.py b/sat/plugins/plugin_xep_0313.py index 393d5280..9d995c1a 100644 --- a/sat/plugins/plugin_xep_0313.py +++ b/sat/plugins/plugin_xep_0313.py @@ -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"))