complete the Exception's list when catching JID error:

- Twisted JID constructor raises not only jid.InvalidFormat but also RuntimeError and AttributeError
This commit is contained in:
souliane 2015-12-15 13:30:47 +01:00
commit a6a967b2f0

View file

@ -562,7 +562,7 @@ class XEP_0045(object):
entity_jid = jid.JID(jid_s).userhostJID()
assert(entity_jid.user)
assert(entity_jid.host)
except (IndexError, jid.InvalidFormat, AssertionError):
except (RuntimeError, jid.InvalidFormat, AttributeError, IndexError, AssertionError):
feedback = _(u"You must provide a valid JID to ban, like in '/ban contact@example.net'")
self.host.plugins[C.TEXT_CMDS].feedBack(feedback, mess_data, profile)
return False
@ -594,7 +594,7 @@ class XEP_0045(object):
entity_jid = jid.JID(jid_s).userhostJID()
assert(entity_jid.user)
assert(entity_jid.host)
except (IndexError, jid.InvalidFormat, AssertionError):
except (RuntimeError, jid.InvalidFormat, AttributeError, IndexError, AssertionError):
feedback = _(u"You must provide a valid JID to affiliate, like in '/affiliate contact@example.net member'")
self.host.plugins[C.TEXT_CMDS].feedBack(feedback, mess_data, profile)
return False