Changeset

4046:467e73951610

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 4045:054e05b27611
children 4047:1a89fd3cc954
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