Mercurial > libervia-backend
comparison src/plugins/plugin_misc_text_commands.py @ 1742:244a605623d6
complete the Exception's list when catching JID error:
- Twisted JID constructor raises not only jid.InvalidFormat but also RuntimeError and AttributeError
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 15 Dec 2015 13:30:47 +0100 |
parents | 3265a2639182 |
children | d17772b0fe22 |
comparison
equal
deleted
inserted
replaced
1741:cc31dd72526d | 1742:244a605623d6 |
---|---|
294 else: | 294 else: |
295 try: | 295 try: |
296 target_jid = jid.JID(entity) | 296 target_jid = jid.JID(entity) |
297 if not target_jid.user or not target_jid.host: | 297 if not target_jid.user or not target_jid.host: |
298 raise jid.InvalidFormat | 298 raise jid.InvalidFormat |
299 except (jid.InvalidFormat, RuntimeError): | 299 except (RuntimeError, jid.InvalidFormat, AttributeError): |
300 self.feedBack(_("Invalid jid, can't whois"), mess_data, profile) | 300 self.feedBack(_("Invalid jid, can't whois"), mess_data, profile) |
301 return False | 301 return False |
302 | 302 |
303 if not target_jid.resource: | 303 if not target_jid.resource: |
304 target_jid.resource = self.host.memory.getMainResource(target_jid, profile) | 304 target_jid.resource = self.host.memory.getMainResource(target_jid, profile) |