Diff

plugins/mod_storage_sql.lua @ 3978:13ee740b1f89

mod_storage_sql: Log an error on query failure.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 27 Dec 2010 06:10:35 +0500
parent 3977:6724853adb80
child 3980:6b2fac6602b3
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Mon Dec 27 06:10:35 2010 +0500
+++ b/plugins/mod_storage_sql.lua	Mon Dec 27 06:10:35 2010 +0500
@@ -91,7 +91,7 @@
 	end
 	-- do prepared statement stuff
 	local stmt, err = connection:prepare(sql);
-	if not stmt then return nil, err; end
+	if not stmt then module:log("error", "QUERY FAILED: %s %s", err, debug.traceback()); return nil, err; end
 	-- run query
 	local ok, err = stmt:execute(host or "", user or "", store or "", ...);
 	if not ok then return nil, err; end