# HG changeset patch # User Kim Alvefur # Date 1469702219 -7200 # Node ID e0808be13d779f25ebc23bbdb263581a2281ec04 # Parent 3abc51faf9459a0d7ac40326cf6e39e7db1df04d mod_cloud_notify: Abort and return error if unable to read storage to prevent loss of existing but unreachable data diff -r 3abc51faf945 -r e0808be13d77 mod_cloud_notify/mod_cloud_notify.lua --- a/mod_cloud_notify/mod_cloud_notify.lua Thu Jul 28 12:35:57 2016 +0200 +++ b/mod_cloud_notify/mod_cloud_notify.lua Thu Jul 28 12:36:59 2016 +0200 @@ -42,8 +42,13 @@ -- Could be intentional origin.log("debug", "No publish options in request"); end - local user_push_services = push_enabled:get(origin.username); + local user_push_services, rerr = push_enabled:get(origin.username); if not user_push_services then + if rerr then + module:log("warn", "Error reading push notification storage: %s", rerr); + origin.send(st.error_reply(stanza, "wait", "internal-server-error")); + return true; + end user_push_services = {}; end user_push_services[push_jid .. "<" .. (push_node or "")] = {