diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-05-24 01:00:30 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-05-24 01:00:30 +0500 |
commit | c918263d056fa6c099bbc704d8e0a17b24d546d7 (patch) | |
tree | 29866b2080e76e37d39119b6b2a13e188b15eebb | |
parent | 4353f95a958a306dfb990d84abe7a922ece80126 (diff) | |
download | prosody-c918263d056fa6c099bbc704d8e0a17b24d546d7.tar.gz prosody-c918263d056fa6c099bbc704d8e0a17b24d546d7.zip |
mod_private: Detect datamanager read errors, and respond with 'internal-server-error'.
-rw-r--r-- | plugins/mod_private.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua index 859bf45a..abf1ec03 100644 --- a/plugins/mod_private.lua +++ b/plugins/mod_private.lua @@ -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]))); |