diff mod_rtbl/mod_rtbl.lua @ 6303:d1d774f79ea8

mod_rtbl: Handle and log iq errors
author Matthew Wild <mwild1@gmail.com>
date Thu, 31 Jul 2025 15:07:30 +0100
parents 13f674a9fb22
children
line wrap: on
line diff
--- a/mod_rtbl/mod_rtbl.lua	Thu Jul 31 15:06:52 2025 +0100
+++ b/mod_rtbl/mod_rtbl.lua	Thu Jul 31 15:07:30 2025 +0100
@@ -119,6 +119,11 @@
 	end
 
 	module:hook("iq-result/host/"..request_id, update_list);
+	module:hook("iq-error/host/"..request_id, function (event)
+		local typ, cond, text = event.stanza:get_error();
+		module:log("warn", "Failed to fetch RTBL contents from %s:%s: %s %s %s", rtbl_service_jid, rtbl_node, typ, cond, text);
+		return true;
+	end);
 	module:add_timer(0, request_list);
 
 	return rtbl;