[IMP] log queries that fail

bzr revid: christophe@tinyerp.com-20090122161549-oo1boehunmtdiw7k
This commit is contained in:
Christophe Simonis 2009-01-22 17:15:49 +01:00
parent 3268209d8c
commit 2b6c38d36f
1 changed files with 5 additions and 1 deletions

View File

@ -113,7 +113,11 @@ class Cursor(object):
if self.sql_log:
now = mdt.now()
res = self._obj.execute(query, params)
try:
res = self._obj.execute(query, params)
except:
log("bad query: %s" % self._obj.query, netsvc.LOG_ERROR)
raise
if self.sql_log:
log("query: %s" % self._obj.query)