diff options
author | David Sommerseth <davids@redhat.com> | 2011-02-03 19:51:30 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-02-03 19:51:30 +0100 |
commit | acb98887895b7c598436e12ac9ad5fc4cbae27a9 (patch) | |
tree | 6562db331acff05e489942cf94ad1774fde69689 | |
parent | bec02b969c63a267467b0afe10f9510cf763fd45 (diff) | |
download | rteval-acb98887895b7c598436e12ac9ad5fc4cbae27a9.tar.gz rteval-acb98887895b7c598436e12ac9ad5fc4cbae27a9.tar.xz rteval-acb98887895b7c598436e12ac9ad5fc4cbae27a9.zip |
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 <davids@redhat.com>
-rw-r--r-- | server/database.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 = [] |