From acb98887895b7c598436e12ac9ad5fc4cbae27a9 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 3 Feb 2011 19:51:30 +0100 Subject: Don't try to always expand SQL SELECT query when throwing an exception If the requested SQL don't have any WHERE values, don't try to expand the SQL query to include them. That just hides the real SQL error. Signed-off-by: David Sommerseth --- server/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/database.py b/server/database.py index 389619c..c749593 100644 --- a/server/database.py +++ b/server/database.py @@ -168,7 +168,7 @@ class Database(object): # If no action is setup (mainly for debugging), return empty result set return {"table": table, "fields": [], "records": []} except Exception, err: - raise Exception, "** SQL ERROR *** %s\n** SQL ERROR ** Message: %s" % ((sql % where), str(err)) + raise Exception, "** SQL ERROR *** %s\n** SQL ERROR ** Message: %s" % (where and (sql % where) or sql, str(err)) # Extract field names fields = [] -- cgit