# HG changeset patch # User Kim Alvefur # Date 1510043208 -3600 # Node ID 6a098961bc008a3eeb60518789d41606a7dc3f15 # Parent 3629639d5fa9202b71e3801e405a2f35c8d54ddb util.sql: Return an error message when a SQL commit fails (LuaDBI doesn't) (Thanks Ge0rG) diff -r 3629639d5fa9 -r 6a098961bc00 util/sql.lua --- a/util/sql.lua Fri Nov 03 01:17:39 2017 +0100 +++ b/util/sql.lua Tue Nov 07 09:26:48 2017 +0100 @@ -236,7 +236,8 @@ if success then log("debug", "SQL transaction success [%s]", tostring(func)); local ok, err = self.conn:commit(); - if not ok then return ok, err; end -- commit failed + -- LuaDBI doesn't actually return an error message here, just a boolean + if not ok then return ok, err or "commit failed"; end return success, a, b, c; else log("debug", "SQL transaction failure [%s]: %s", tostring(func), a.err);