diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-28 17:31:55 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-28 17:31:55 +0200 |
commit | bcc0a4f11d07b3ff01011790c33abf1b4298c244 (patch) | |
tree | d2c42dd8f5611d3741313ee627dd6f42e7e4f67e /util/datamanager.lua | |
parent | ba5133a97723367212b65a9c27cc91c74928f394 (diff) | |
download | prosody-bcc0a4f11d07b3ff01011790c33abf1b4298c244.tar.gz prosody-bcc0a4f11d07b3ff01011790c33abf1b4298c244.zip |
util.datamanager: Log where the error came from
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r-- | util/datamanager.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index 2ed672e5..6edf7ac0 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -240,7 +240,7 @@ local function append(username, host, datastore, ext, data) ok, msg = f:close(); if not ok then - return ok, msg; + return ok, msg, "close"; end return true, pos; @@ -252,9 +252,10 @@ local function list_append(username, host, datastore, data) -- save the datastore data = "item(" .. serialize(data) .. ");\n"; - local ok, msg = append(username, host, datastore, "list", data); + local ok, msg, where = append(username, host, datastore, "list", data); if not ok then - log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); + log("error", "Unable to write to %s storage ('%s' in %s) for user: %s@%s", + datastore, msg, where, username or "nil", host or "nil"); return ok, msg; end return true; |