# HG changeset patch # User Goffi # Date 1562421108 -7200 # Node ID 6959c71ab8bfc3f70bf393351159add52edf3cbd # Parent c13333fcde5e040a51f68e3d399e5c845653bb2e plugin XEP-0045: log "failure" on configure error diff -r c13333fcde5e -r 6959c71ab8bf sat/core/sat_main.py --- a/sat/core/sat_main.py Sat Jul 06 15:50:55 2019 +0200 +++ b/sat/core/sat_main.py Sat Jul 06 15:51:48 2019 +0200 @@ -596,12 +596,13 @@ """ 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 diff -r c13333fcde5e -r 6959c71ab8bf sat/plugins/plugin_xep_0045.py --- a/sat/plugins/plugin_xep_0045.py Sat Jul 06 15:50:55 2019 +0200 +++ b/sat/plugins/plugin_xep_0045.py Sat Jul 06 15:51:48 2019 +0200 @@ -237,7 +237,8 @@ # 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):