From 3b2386ee2f083f47cb37a6670e4f1730f491c24e Mon Sep 17 00:00:00 2001 From: nicoco Date: Sat, 28 Sep 2024 10:28:20 +0200 Subject: [PATCH] stanzabase: Pass problematic object to TypeError raised by ElementBase.append() This should help debugging those type of errors. --- slixmpp/xmlstream/stanzabase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slixmpp/xmlstream/stanzabase.py b/slixmpp/xmlstream/stanzabase.py index a95cf414..e2834af6 100644 --- a/slixmpp/xmlstream/stanzabase.py +++ b/slixmpp/xmlstream/stanzabase.py @@ -1230,7 +1230,7 @@ class ElementBase(object): if type(item) == XML_TYPE: return self.appendxml(item) else: - raise TypeError + raise TypeError(f"Cannot append {item!r} to a stanza") self.xml.append(item.xml) if item.__class__ == self.plugin_tag_map.get(item.tag_name(), None): self.init_plugin(item.plugin_attrib,