Changeset

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
parents 3977:6724853adb80
children 3979:bf223e6c2b4c
files plugins/mod_storage_sql.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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