Changeset

7318:1fa6052f3a07

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 26 Mar 2016 14:54:39 +0100
parents 7316:62d533535334 (current diff) 7317:a2dce746599b (diff)
children 7320:3849b5187d47
files
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Thu Mar 24 13:57:58 2016 +0100
+++ b/util/sql.lua	Sat Mar 26 14:54:39 2016 +0100
@@ -202,6 +202,10 @@
 		engine.update = engine.execute_update;
 	end
 end
+local function handleerr(err)
+	log("error", "Error in SQL transaction: %s", debug_traceback(err, 3));
+	return err;
+end
 function engine:_transaction(func, ...)
 	if not self.conn then
 		local ok, err = self:connect();
@@ -212,7 +216,7 @@
 	local function f() return func(unpack(args, 1, n_args)); end
 	log("debug", "SQL transaction begin [%s]", tostring(func));
 	self.__transaction = true;
-	local success, a, b, c = xpcall(f, debug_traceback);
+	local success, a, b, c = xpcall(f, handleerr);
 	self.__transaction = nil;
 	if success then
 		log("debug", "SQL transaction success [%s]", tostring(func));