# HG changeset patch # User Matthew Wild # Date 1435183010 -3600 # Node ID 845bc5ba306dcaae548513e6cb54fb65d854781a # Parent 9f932a31eeba141f834a93a282804be7f105a9e9 mod_storage_sql2: Improve logging when database read fails diff -r 9f932a31eeba -r 845bc5ba306d plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Wed Jun 24 22:55:41 2015 +0100 +++ b/plugins/mod_storage_sql2.lua Wed Jun 24 22:56:50 2015 +0100 @@ -199,8 +199,11 @@ 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 "", result); + return nil, result; + end + return result; end function keyval_store:set(username, data) user,store = username,self.store;