plugin XEP-0045: log "failure" on configure error

This commit is contained in:
Goffi 2019-07-06 15:51:48 +02:00
commit c857c375fc
2 changed files with 6 additions and 4 deletions

View file

@ -596,12 +596,13 @@ class SAT(service.Service):
"""
return unicode(self.memory.getConfig(section, name, ""))
def logErrback(self, failure_):
"""generic errback logging
def logErrback(self, failure_, msg=_(u"Unexpected error: {failure_}")):
"""Generic errback logging
@param msg(unicode): error message ("failure_" key will be use for format)
can be used as last errback to show unexpected error
"""
log.error(_(u"Unexpected error: {}".format(failure_)))
log.error(msg.format(failure_=failure_))
return failure_
#  namespaces

View file

@ -237,7 +237,8 @@ class XEP_0045(object):
# a proper configuration management should be done
log.debug(_(u"room locked !"))
d = client._muc_client.configure(room.roomJID, {})
d.addErrback(lambda __: log.error(_(u'Error while configuring the room')))
d.addErrback(self.host.logErrback,
msg=_(u'Error while configuring the room: {failure_}'))
return room.fully_joined
def _joinEb(self, failure, client, room_jid, nick, password):