comparison plugins/mod_bookmarks.lua @ 13547:d6545c533ce2 0.12

mod_bookmarks: Clarify log messages on failure to sync to modern PEP bookmarks Previously the error messages said that it failed to "publish" to PEP, but sometimes a sync involves removing items, which can be confusing. The log was also the same for both legacy PEP and private XML bookmarks. Having different log messages makes it easier to debug the cause and location of any sync errors.
author Matthew Wild <mwild1@gmail.com>
date Fri, 08 Nov 2024 10:28:29 +0000
parents 1a915c2e0fa4
children 84ee435f284e
comparison
equal deleted inserted replaced
13546:1a915c2e0fa4 13547:d6545c533ce2
312 312
313 module:log("debug", "Legacy PEP bookmarks set by client, publishing to PEP."); 313 module:log("debug", "Legacy PEP bookmarks set by client, publishing to PEP.");
314 314
315 local ok, err = publish_to_pep(session.full_jid, bookmarks, true); 315 local ok, err = publish_to_pep(session.full_jid, bookmarks, true);
316 if not ok then 316 if not ok then
317 module:log("error", "Failed to publish to PEP bookmarks for %s@%s: %s", session.username, session.host, err); 317 module:log("error", "Failed to sync legacy bookmarks to PEP for %s@%s: %s", session.username, session.host, err);
318 session.send(st.error_reply(stanza, "cancel", "internal-server-error", "Failed to store bookmarks to PEP")); 318 session.send(st.error_reply(stanza, "cancel", "internal-server-error", "Failed to store bookmarks to PEP"));
319 return true; 319 return true;
320 end 320 end
321 321
322 session.send(st.reply(stanza)); 322 session.send(st.reply(stanza));
338 338
339 module:log("debug", "Private bookmarks set by client, publishing to PEP."); 339 module:log("debug", "Private bookmarks set by client, publishing to PEP.");
340 340
341 local ok, err = publish_to_pep(session.full_jid, bookmarks, true); 341 local ok, err = publish_to_pep(session.full_jid, bookmarks, true);
342 if not ok then 342 if not ok then
343 module:log("error", "Failed to publish to PEP bookmarks for %s@%s: %s", session.username, session.host, err); 343 module:log("error", "Failed to sync private XML bookmarks to PEP for %s@%s: %s", session.username, session.host, err);
344 session.send(st.error_reply(stanza, "cancel", "internal-server-error", "Failed to store bookmarks to PEP")); 344 session.send(st.error_reply(stanza, "cancel", "internal-server-error", "Failed to store bookmarks to PEP"));
345 return true; 345 return true;
346 end 346 end
347 347
348 session.send(st.reply(stanza)); 348 session.send(st.reply(stanza));