# HG changeset patch # User Goffi # Date 1563947508 -7200 # Node ID 1f74cd0f22c3e456de9685bc1e113355bbf855df # Parent 03fe31effa7fe7bd096d937abb18c910837c1915 plugin XEP-0313: log issues in addToHistory instead of raising error diff -r 03fe31effa7f -r 1f74cd0f22c3 sat/plugins/plugin_xep_0313.py --- a/sat/plugins/plugin_xep_0313.py Wed Jul 24 07:51:07 2019 +0200 +++ b/sat/plugins/plugin_xep_0313.py Wed Jul 24 07:51:48 2019 +0200 @@ -135,7 +135,15 @@ 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"))