diff options
author | Kim Alvefur <zash@zash.se> | 2016-03-26 14:54:39 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-03-26 14:54:39 +0100 |
commit | bd7661932c7f620a72cbded20299e72d9e83e5c0 (patch) | |
tree | 4ae873335fac8ab24744036958a1be02552a52bd /util/sql.lua | |
parent | 1c4e23ccddeffdc45eb6de28460205f5da7fab82 (diff) | |
parent | 935e3cce462a650a95208dbdfa11aad5409c2547 (diff) | |
download | prosody-bd7661932c7f620a72cbded20299e72d9e83e5c0.tar.gz prosody-bd7661932c7f620a72cbded20299e72d9e83e5c0.zip |
Merge 0.10->trunk
Diffstat (limited to 'util/sql.lua')
-rw-r--r-- | util/sql.lua | 6 |
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)); |