summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2017-10-11 23:41:32 +0200
committermathieui <mathieui@mathieui.net>2017-10-11 23:41:32 +0200
commit38a0e614d46b89316997964f37370ab280c2dbb7 (patch)
tree1d1806cec7078432dab5aafaaec424530c88a432
parent9a7c2c2136e8f928c218456d432b5d367f2c1aa0 (diff)
downloadpoezio-38a0e614d46b89316997964f37370ab280c2dbb7.tar.gz
poezio-38a0e614d46b89316997964f37370ab280c2dbb7.tar.bz2
poezio-38a0e614d46b89316997964f37370ab280c2dbb7.tar.xz
poezio-38a0e614d46b89316997964f37370ab280c2dbb7.zip
Narrow the scope of a try/except
-rw-r--r--poezio/multiuserchat.py3
1 files changed, 2 insertions, 1 deletions
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):