diff sat/core/sat_main.py @ 2990:6959c71ab8bf

plugin XEP-0045: log "failure" on configure error
author Goffi <goffi@goffi.org>
date Sat, 06 Jul 2019 15:51:48 +0200
parents 06f30ad8e110
children ab2696e34d29
line wrap: on
line diff
--- 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