Comparison

plugins/mod_mam/mod_mam.lua @ 9554:cba6e6168d26

mod_mam: Upgrade case of invalid archive store driver to hard error
author Kim Alvefur <zash@zash.se>
date Thu, 25 Oct 2018 21:58:22 +0200
parent 9553:9a5485550bfd
child 9555:ed5a5ddcef17
comparison
equal deleted inserted replaced
9553:9a5485550bfd 9554:cba6e6168d26
39 39
40 local archive_store = module:get_option_string("archive_store", "archive"); 40 local archive_store = module:get_option_string("archive_store", "archive");
41 local archive = module:open_store(archive_store, "archive"); 41 local archive = module:open_store(archive_store, "archive");
42 42
43 if not archive.find then 43 if not archive.find then
44 module:log("debug", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API"); 44 error("mod_"..(archive._provided_by or archive.name and "storage_"..archive.name).." does not support archiving\n"
45 module:log("debug", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or "<unknown>"); 45 .."See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information");
46 module:log("debug", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information");
47 module:log("info", "Using in-memory fallback archive driver");
48 archive = module:require "fallback_archive";
49 end 46 end
50 47
51 local use_total = module:get_option_boolean("mam_include_total", true); 48 local use_total = module:get_option_boolean("mam_include_total", true);
52 49
53 local cleanup; 50 local cleanup;