comparison src/plugins/plugin_exp_command_export.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 22a8e770cb7b
children d17772b0fe22
comparison
equal deleted inserted replaced
1741:cc31dd72526d 1742:244a605623d6
149 try: 149 try:
150 _jid = jid.JID(target) 150 _jid = jid.JID(target)
151 if not _jid.user or not _jid.host: 151 if not _jid.user or not _jid.host:
152 raise jid.InvalidFormat 152 raise jid.InvalidFormat
153 _jid = _jid.userhostJID() 153 _jid = _jid.userhostJID()
154 except (jid.InvalidFormat, RuntimeError): 154 except (RuntimeError, jid.InvalidFormat, AttributeError):
155 log.info(u"invalid target ignored: %s" % (target,)) 155 log.info(u"invalid target ignored: %s" % (target,))
156 continue 156 continue
157 process_prot = ExportCommandProtocol(self, _jid, options, profile) 157 process_prot = ExportCommandProtocol(self, _jid, options, profile)
158 self.spawned.setdefault((_jid, profile),set()).add(process_prot) 158 self.spawned.setdefault((_jid, profile),set()).add(process_prot)
159 reactor.spawnProcess(process_prot, command, args, usePTY = process_prot.boolOption('pty')) 159 reactor.spawnProcess(process_prot, command, args, usePTY = process_prot.boolOption('pty'))