Changeset

8014:ff3787033abb

util.datamanager: Log where the error came from
author Kim Alvefur <zash@zash.se>
date Tue, 28 Mar 2017 17:31:55 +0200
parents 8013:72cfbe377326
children 8015:ecb110f45c92 8016:9546c629289b
files util/datamanager.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/datamanager.lua	Tue Mar 28 17:31:24 2017 +0200
+++ b/util/datamanager.lua	Tue Mar 28 17:31:55 2017 +0200
@@ -240,7 +240,7 @@
 
 	ok, msg = f:close();
 	if not ok then
-		return ok, msg;
+		return ok, msg, "close";
 	end
 
 	return true, pos;
@@ -252,9 +252,10 @@
 	-- 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;