aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql2.lua
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
commita05283925c13a2c30393366bd27254c69ad596ad (patch)
tree33709b9704954b94aba4ec6c6c1e655fc9d7cf62 /plugins/mod_storage_sql2.lua
parent0c49a317408d4e32139819586810d63faca5f339 (diff)
downloadprosody-a05283925c13a2c30393366bd27254c69ad596ad.tar.gz
prosody-a05283925c13a2c30393366bd27254c69ad596ad.zip
mod_storage_sql2: Improve logging when database read fails
Diffstat (limited to 'plugins/mod_storage_sql2.lua')
-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;