From 33a1519a3914906566de656daa63a5a778cf3a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 23 Aug 2019 11:27:58 +0200 Subject: omemo: Catch IqError and IqTimeout and display generic message for now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/omemo_plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/omemo_plugin.py b/plugins/omemo_plugin.py index c676267a..345925f6 100644 --- a/plugins/omemo_plugin.py +++ b/plugins/omemo_plugin.py @@ -17,6 +17,7 @@ from poezio.xdg import DATA_HOME from omemo.exceptions import MissingBundleException from slixmpp.stanza import Message +from slixmpp.exceptions import IqError, IqTimeout from slixmpp_omemo import PluginCouldNotLoad, MissingOwnKey, NoAvailableSession from slixmpp_omemo import UndecidedException, UntrustedException, EncryptionPrepareException import slixmpp_omemo @@ -144,6 +145,11 @@ class Plugin(E2EEPlugin): ) device_list = expect_problems.setdefault(exn.bare_jid, []) device_list.append(exn.device) + except (IqError, IqTimeout) as exn: + self.display_error( + 'An error occured while fetching information on a recipient.\n%r' % exn, + ) + return None except Exception as exn: self.display_error( 'An error occured while attempting to encrypt.\n%r' % exn, -- cgit v1.2.3