mod_storage_xmlarchive: Raise error instead of warning if there's ever more than one stanza in a chunk (this indicates some kind of corruption)
authorKim Alvefur <zash@zash.se>
Mon, 20 Feb 2017 01:47:44 +0100
changeset 2518 d47a7e6e9adc
parent 2517 66a61f48e376
child 2519 4cb549622862
mod_storage_xmlarchive: Raise error instead of warning if there's ever more than one stanza in a chunk (this indicates some kind of corruption)
mod_storage_xmlarchive/mod_storage_xmlarchive.lua
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Mon Feb 20 00:09:45 2017 +0100
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Mon Feb 20 01:47:44 2017 +0100
@@ -83,9 +83,7 @@
 
 	local result;
 	local function cb(_, stanza)
-		if result then
-			module:log("warn", "Multiple items in chunk");
-		end
+		assert(not result, "Multiple items in chunk");
 		result = stanza;
 	end