changeset 3316:5369ce5bcecf

core (xmpp): text can now be specified in `sendError`
author Goffi <goffi@goffi.org>
date Sat, 01 Aug 2020 15:59:49 +0200
parents 53b229761c9d
children 83f25da66bec
files sat/core/xmpp.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/xmpp.py	Sat Aug 01 15:58:20 2020 +0200
+++ b/sat/core/xmpp.py	Sat Aug 01 15:59:49 2020 +0200
@@ -532,13 +532,13 @@
         iq_elt.timeout = timeout
         return iq_elt
 
-    def sendError(self, iq_elt, condition):
+    def sendError(self, iq_elt, condition, text=None):
         """Send error stanza build from iq_elt
 
         @param iq_elt(domish.Element): initial IQ element
         @param condition(unicode): error condition
         """
-        iq_error_elt = error.StanzaError(condition).toResponse(iq_elt)
+        iq_error_elt = error.StanzaError(condition, text=text).toResponse(iq_elt)
         self.xmlstream.send(iq_error_elt)
 
     def generateMessageXML(self, data, post_xml_treatments=None):
@@ -1466,8 +1466,8 @@
                     del self._groups[group]
             except KeyError:
                 log.warning(
-                    "there is no cache for the group [{group}] of the removed roster "
-                    "item [{jid_}]".format(group=group, jid=entity)
+                    f"there is no cache for the group [{group}] of the removed roster "
+                    f"item [{entity}]"
                 )
 
         # then we send the bridge signal