aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-06-24 22:56:50 +0100
committerMatthew Wild <mwild1@gmail.com>2015-06-24 22:56:50 +0100
commit2fa493db42818bedbd65f2d892fe0df4e4c7f21b (patch)
tree33709b9704954b94aba4ec6c6c1e655fc9d7cf62
parentd6f89f59be5f5e26977a58b3c6a758d124c2171a (diff)
downloadprosody-2fa493db42818bedbd65f2d892fe0df4e4c7f21b.tar.gz
prosody-2fa493db42818bedbd65f2d892fe0df4e4c7f21b.zip
mod_storage_sql2: Improve logging when database read fails
-rw-r--r--plugins/mod_storage_sql2.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index f14d32ec..74d08801 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -199,8 +199,11 @@ keyval_store.__index = keyval_store;
function keyval_store:get(username)
user, store = username, self.store;
local ok, result = engine:transaction(keyval_store_get);
- if not ok then return ok, result; end
- return result;
+ if not ok then
+ module:log("error", "Unable to read from database %s store for %s: %s", store, username or "<host>", result);
+ return nil, result;
+ end
+ return result;
end
function keyval_store:set(username, data)
user,store = username,self.store;