From 633e1eb2034445f956d18615a2e15fa5165ad9ba Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 24 Jul 2019 07:51:48 +0200 Subject: [PATCH] plugin XEP-0313: log issues in addToHistory instead of raising error --- sat/plugins/plugin_xep_0313.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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"))