comparison 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
comparison
equal deleted inserted replaced
6302:13f674a9fb22 6303:d1d774f79ea8
117 module:log("info", "%d RTBL entries received from %s:%s (%d added, %d removed)", n_total, from_jid, rtbl_node, n_added, n_removed); 117 module:log("info", "%d RTBL entries received from %s:%s (%d added, %d removed)", n_total, from_jid, rtbl_node, n_added, n_removed);
118 return true; 118 return true;
119 end 119 end
120 120
121 module:hook("iq-result/host/"..request_id, update_list); 121 module:hook("iq-result/host/"..request_id, update_list);
122 module:hook("iq-error/host/"..request_id, function (event)
123 local typ, cond, text = event.stanza:get_error();
124 module:log("warn", "Failed to fetch RTBL contents from %s:%s: %s %s %s", rtbl_service_jid, rtbl_node, typ, cond, text);
125 return true;
126 end);
122 module:add_timer(0, request_list); 127 module:add_timer(0, request_list);
123 128
124 return rtbl; 129 return rtbl;
125 end 130 end