Mercurial > libervia-backend
comparison plugins/plugin_xep_0100.py @ 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 | 06985b6ad23a |
children | 8537df794f74 |
comparison
equal
deleted
inserted
replaced
173:ec6611445a5b | 174:fbae69247b15 |
---|---|
21 | 21 |
22 from logging import debug, info, error | 22 from logging import debug, info, error |
23 from twisted.internet import protocol | 23 from twisted.internet import protocol |
24 from twisted.words.protocols.jabber import client, jid | 24 from twisted.words.protocols.jabber import client, jid |
25 from twisted.words.protocols.jabber import error as jab_error | 25 from twisted.words.protocols.jabber import error as jab_error |
26 import twisted.internet.error | |
26 import pdb | 27 import pdb |
27 | 28 |
28 from wokkel import disco, iwokkel | 29 from wokkel import disco, iwokkel |
29 | 30 |
30 PLUGIN_INFO = { | 31 PLUGIN_INFO = { |
69 | 70 |
70 self.__inc_handled_items(request_id) | 71 self.__inc_handled_items(request_id) |
71 | 72 |
72 def discoInfoErr(self, failure, entity, request_id): | 73 def discoInfoErr(self, failure, entity, request_id): |
73 """Something is going wrong with disco""" | 74 """Something is going wrong with disco""" |
74 failure.trap(jab_error.StanzaError) | 75 failure.trap(jab_error.StanzaError,twisted.internet.error.ConnectionLost) |
75 error(_("Error when discovering [%(jid)s]: %(condition)s") % {'jid':entity.full(), 'condition':failure.value.condition}) | 76 error(_("Error when discovering [%(jid)s]: %(error)s") % {'jid':entity.full(), 'error':failure.getErrorMessage()}) |
76 self.__inc_handled_items(request_id) | 77 self.__inc_handled_items(request_id) |
77 | 78 |
78 | 79 |
79 def discoItems(self, disco, request_id, target, client): | 80 def discoItems(self, disco, request_id, target, client): |
80 """Look for items with disco protocol, and ask infos for each one""" | 81 """Look for items with disco protocol, and ask infos for each one""" |