diff mod_log_messages_sql/mod_log_messages_sql.lua @ 1641:1fa25cfb0ad4

Merge
author Kim Alvefur <zash@zash.se>
date Tue, 31 Mar 2015 18:31:13 +0200
parents 398c4aaccf6d
children be08b65f2855
line wrap: on
line diff
--- a/mod_log_messages_sql/mod_log_messages_sql.lua	Mon Mar 30 01:17:35 2015 +0200
+++ b/mod_log_messages_sql/mod_log_messages_sql.lua	Tue Mar 31 18:31:13 2015 +0200
@@ -98,7 +98,11 @@
 	return ...;
 end
 function sql.commit(...)
-	if not connection:commit() then return nil, "SQL commit failed"; end
+	local ok, err = connection:commit();
+	if not ok then
+		module:log("error", "SQL commit failed: %s", tostring(err));
+		return nil, "SQL commit failed: "..tostring(err);
+	end
 	return ...;
 end