comparison src/plugins/plugin_exp_parrot.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
137 137
138 try: 138 try:
139 link_left_jid = jid.JID(mess_data["unparsed"].strip()) 139 link_left_jid = jid.JID(mess_data["unparsed"].strip())
140 if not link_left_jid.user or not link_left_jid.host: 140 if not link_left_jid.user or not link_left_jid.host:
141 raise jid.InvalidFormat 141 raise jid.InvalidFormat
142 except jid.InvalidFormat: 142 except (RuntimeError, jid.InvalidFormat, AttributeError):
143 txt_cmd.feedBack("Can't activate Parrot mode for invalid jid", mess_data, profile) 143 txt_cmd.feedBack("Can't activate Parrot mode for invalid jid", mess_data, profile)
144 return False 144 return False
145 145
146 link_right_jid = mess_data['to'] 146 link_right_jid = mess_data['to']
147 147