--- a/scansion/objects/client.lua Mon Sep 10 10:16:38 2018 +0100 +++ b/scansion/objects/client.lua Mon Sep 10 13:45:47 2018 +0100 @@ -94,7 +94,10 @@ end local function stanza_handler(received_stanza) if not expected_stanza then - error(new_error("Received unexpected stanza", { stanza = tostring(received_stanza) })); + error(new_error("unexpected-stanza", { + text = "Received unexpected stanza"; + stanza = tostring(received_stanza); + })); elseif not expected_stanza or not stanzacmp.stanzas_match(expected_stanza, received_stanza) then if not expected_stanza then client.log("Received a stanza when none were expected: %s", received_stanza); @@ -102,7 +105,8 @@ client.log("Expected: %s", expected_stanza); client.log("Received: %s", received_stanza); end - error(new_error("Received unexpected stanza", { + error(new_error("unexpected-stanza", { + text = "Received unexpected stanza"; stanza = tostring(received_stanza); expected = expected_stanza and tostring(expected_stanza) or nil; }));