mod_posix: Some (perhaps temporary) changes to re-lock the pidfile after truncating...
[prosody.git] / plugins / mod_private.lua
index 859bf45a6ec12bc5dbc406a59b48c4279f9175b5..abf1ec039a5d076c361d39784a2ce16dc453f757 100644 (file)
@@ -26,7 +26,11 @@ module:add_iq_handler("c2s", "jabber:iq:private",
                                if #query.tags == 1 then
                                        local tag = query.tags[1];
                                        local key = tag.name..":"..tag.attr.xmlns;
-                                       local data = datamanager.load(node, host, "private");
+                                       local data, err = datamanager.load(node, host, "private");
+                                       if err then
+                                               session.send(st.error_reply(stanza, "wait", "internal-server-error"));
+                                               return true;
+                                       end
                                        if stanza.attr.type == "get" then
                                                if data and data[key] then
                                                        session.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:private"}):add_child(st.deserialize(data[key])));