From 01b9f37dac2f5f1e976704e30c0c1f6e30755146 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 22 Dec 2021 00:06:07 +0100 Subject: /disco plugin: Add error handling It was missing. --- plugins/disco.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/disco.py b/plugins/disco.py index 52963d39..eea3a411 100644 --- a/plugins/disco.py +++ b/plugins/disco.py @@ -18,6 +18,7 @@ Usage from poezio.plugin import BasePlugin from poezio.decorators import command_args_parser from slixmpp.jid import InvalidJID +from slixmpp.exceptions import IqError, IqTimeout class Plugin(BasePlugin): @@ -99,3 +100,7 @@ class Plugin(BasePlugin): self.on_items(iq) except InvalidJID as e: self.api.information('Invalid JID “%s”: %s' % (jid, e), 'Error') + except IqError as e: + self.api.information('Received iq error while querying “%s”: %s' % (jid, e), 'Error') + except IqTimeout: + self.api.information('Received no reply querying “%s”…' % jid, 'Error') -- cgit v1.2.3