client: Throw scansion error on stanza timeout, to avoid traceback

Tue, 11 Sep 2018 21:32:53 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 11 Sep 2018 21:32:53 +0100
changeset 130
ce99abde467b
parent 129
ff11f32d2499
child 131
2d19fdddb9ee

client: Throw scansion error on stanza timeout, to avoid traceback

scansion/objects/client.lua file | annotate | diff | comparison | revisions
--- a/scansion/objects/client.lua	Tue Sep 11 21:25:40 2018 +0100
+++ b/scansion/objects/client.lua	Tue Sep 11 21:32:53 2018 +0100
@@ -131,7 +131,8 @@
 		verse.add_task(client.stanza_timeout or default_stanza_timeout, function ()
 			if expected_stanza then
 				client.log("TIMEOUT waiting for %s", expected_stanza)
-				error("Timed out waiting for stanza");
+				local e = new_error("stanza-timeout", { text = "Timed out waiting for stanza" });
+				error(e);
 			end
 			if expected_stanza == false then
 				client.log("Good - no stanzas were received (expected)");

mercurial