comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 3755:bb18a1f5e9d7

mod_storage_xmlarchive: Log error writing XML since datamanager doesn't
author Kim Alvefur <zash@zash.se>
date Thu, 21 Nov 2019 16:35:31 +0100
parents c24d43ababc6
children e9e19b9a6a55
comparison
equal deleted inserted replaced
3754:d77a61d81555 3755:bb18a1f5e9d7
34 data = tostring(data) .. "\n"; 34 data = tostring(data) .. "\n";
35 35
36 local day = dt.date(when); 36 local day = dt.date(when);
37 local ok, err = dm.append_raw(username.."@"..day, self.host, self.store, "xml", data); 37 local ok, err = dm.append_raw(username.."@"..day, self.host, self.store, "xml", data);
38 if not ok then 38 if not ok then
39 -- append_raw, unlike list_append, does not log anything on failure atm, so we do so here
40 module:log("error", "Unable to write to %s storage ('%s') for user: %s@%s",
41 self.store, err, username, module.host)
39 return nil, err; 42 return nil, err;
40 end 43 end
41 44
42 -- If the day-file is missing then we need to add it to the list of days 45 -- If the day-file is missing then we need to add it to the list of days
43 local first_of_day = not lfs.attributes(dm.getpath(username .. "@" .. day, self.host, self.store, "list")); 46 local first_of_day = not lfs.attributes(dm.getpath(username .. "@" .. day, self.host, self.store, "list"));