changeset 174:fbae69247b15

Core: plugin 0100: added connection lost management for disco info
author Goffi <goffi@goffi.org>
date Thu, 12 Aug 2010 18:27:42 +0800
parents ec6611445a5b
children 8537df794f74
files plugins/plugin_xep_0100.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/plugin_xep_0100.py	Thu Aug 12 13:18:22 2010 +0800
+++ b/plugins/plugin_xep_0100.py	Thu Aug 12 18:27:42 2010 +0800
@@ -23,6 +23,7 @@
 from twisted.internet import protocol
 from twisted.words.protocols.jabber import client, jid
 from twisted.words.protocols.jabber import error as jab_error
+import twisted.internet.error
 import pdb
 
 from wokkel import disco, iwokkel
@@ -71,8 +72,8 @@
     
     def discoInfoErr(self, failure, entity, request_id):
         """Something is going wrong with disco"""
-        failure.trap(jab_error.StanzaError)
-        error(_("Error when discovering [%(jid)s]: %(condition)s") % {'jid':entity.full(), 'condition':failure.value.condition})
+        failure.trap(jab_error.StanzaError,twisted.internet.error.ConnectionLost)
+        error(_("Error when discovering [%(jid)s]: %(error)s") % {'jid':entity.full(), 'error':failure.getErrorMessage()})
         self.__inc_handled_items(request_id)