From ce1271df1d153a41fb7a063e983dd51ab9226ebb Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 31 Aug 2016 16:40:26 +0100 Subject: stanza_router: Make 'unhandled stanza' errors more informative --- core/stanza_router.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/stanza_router.lua b/core/stanza_router.lua index fb30eef5..cf098258 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -36,7 +36,12 @@ local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore -- A normal stanza local st_type = stanza.attr.type; if st_type == "error" or (name == "iq" and st_type == "result") then - log("debug", "Discarding %s from %s of type: %s", name, origin_type, st_type or ''); + if st_type == "error" then + local err_type, err_condition, err_message = stanza:get_error(); + log("debug", "Discarding unhandled error %s (%s, %s) from %s: %s", name, err_type, err_condition or "unknown condition", origin_type, stanza:top_tag()); + else + log("debug", "Discarding %s from %s of type: %s", name, origin_type, st_type or ''); + end return; end if name == "iq" and (st_type == "get" or st_type == "set") and stanza.tags[1] then -- cgit v1.2.3