From 38a0e614d46b89316997964f37370ab280c2dbb7 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 11 Oct 2017 23:41:32 +0200 Subject: [PATCH] Narrow the scope of a try/except --- poezio/multiuserchat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py index 1ed2fa23..92101f23 100644 --- a/poezio/multiuserchat.py +++ b/poezio/multiuserchat.py @@ -14,6 +14,7 @@ slix plugin from xml.etree import cElementTree as ET from poezio.common import safeJID +from slixmpp.exceptions import IqError, IqTimeout import logging log = logging.getLogger(__name__) @@ -144,7 +145,7 @@ def set_user_role(xmpp, jid, nick, reason, role, callback=None): return iq.send(callback=callback) try: return iq.send() - except Exception as e: + except (IqError, IqTimeout) as e: return e.iq def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason=None, callback=None):