aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-03-26 14:54:39 +0100
committerKim Alvefur <zash@zash.se>2016-03-26 14:54:39 +0100
commit4173551bfe86132de4392086b91988ee91c46cd0 (patch)
tree4ae873335fac8ab24744036958a1be02552a52bd /util/sql.lua
parent4ca8e2aaed9b4e58ee1a9b67bb8a6d9f99e51632 (diff)
parentc24be27b2f9a76001ff4c3de442606b05543ed7e (diff)
downloadprosody-4173551bfe86132de4392086b91988ee91c46cd0.tar.gz
prosody-4173551bfe86132de4392086b91988ee91c46cd0.zip
Merge 0.10->trunk
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 657acb79..acdf9c63 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -202,6 +202,10 @@ function engine:debug(enable)
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 @@ function engine:_transaction(func, ...)
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));