Diff

plugins/mod_storage_sql.lua @ 5209:f5d121846d53

mod_storage_sql: Return actual error string on commit failure.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 30 Nov 2012 08:50:03 +0500
parent 5154:429c8eeea035
child 5776:bd0ff8ae98a8
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Thu Nov 29 07:38:00 2012 +0500
+++ b/plugins/mod_storage_sql.lua	Fri Nov 30 08:50:03 2012 +0500
@@ -228,7 +228,8 @@
 	return ...;
 end
 local function commit(...)
-	if not connection:commit() then return nil, "SQL commit failed"; end
+	local success,err = connection:commit();
+	if not success then return nil, "SQL commit failed: "..tostring(err); end
 	return ...;
 end