Comparison

plugins/muc/mod_muc.lua @ 8841:bc8558bbc797

MUC: Fix error logged when no persistent rooms present
author Matthew Wild <mwild1@gmail.com>
date Wed, 30 May 2018 21:02:09 +0100
parent 8705:1d66f66a13c9
child 8843:041ddc670934
comparison
equal deleted inserted replaced
8840:4a5ff09887a4 8841:bc8558bbc797
37 rooms = {}; 37 rooms = {};
38 local rooms = rooms; 38 local rooms = rooms;
39 local persistent_rooms_storage = module:open_store("persistent"); 39 local persistent_rooms_storage = module:open_store("persistent");
40 local persistent_rooms, err = persistent_rooms_storage:get(); 40 local persistent_rooms, err = persistent_rooms_storage:get();
41 if not persistent_rooms then 41 if not persistent_rooms then
42 module:log("error", "Error loading list of persistent rooms from storage. Reload mod_muc or restart to recover."); 42 if err then
43 assert(not err, err); 43 module:log("error", "Error loading list of persistent rooms from storage. Reload mod_muc or restart to recover.");
44 error("Storage error: "..err);
45 end
46 module:log("debug", "No persistent rooms found in the database");
44 persistent_rooms = {}; 47 persistent_rooms = {};
45 end 48 end
46 local room_configs = module:open_store("config"); 49 local room_configs = module:open_store("config");
47 50
48 -- Configurable options 51 -- Configurable options