plugin XEP-0060: trap failure when subscription to a node is not possible
This commit is contained in:
parent
a668b23efc
commit
7f1d5a9eca
1 changed files with 6 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ from sat.core import exceptions
|
|||
|
||||
from sat.tools import sat_defer
|
||||
|
||||
from twisted.words.protocols.jabber import jid
|
||||
from twisted.words.protocols.jabber import jid, error
|
||||
from twisted.internet import defer
|
||||
from wokkel import disco
|
||||
# XXX: tmp.pubsub is actually use instead of wokkel version
|
||||
|
|
@ -244,8 +244,12 @@ class XEP_0060(object):
|
|||
except KeyError:
|
||||
subscribe = False
|
||||
|
||||
def subscribeEb(failure, service, node):
|
||||
failure.trap(error.StanzaError)
|
||||
log.warning("Could not subscribe to node {} on service {}: {}".format(node, unicode(service), unicode(failure.value)))
|
||||
|
||||
def doSubscribe(items):
|
||||
self.subscribe(service, node, profile_key=profile_key)
|
||||
self.subscribe(service, node, profile_key=profile_key).addErrback(subscribeEb, service, node)
|
||||
return items
|
||||
|
||||
if subscribe:
|
||||
|
|
|
|||
Loading…
Reference in a new issue