Commit ba5f4f56 authored by Jérome Perrin's avatar Jérome Perrin

use constants for MySQLdb rather than 1064


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34689 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a1a77e2b
...@@ -406,8 +406,8 @@ class DB(TM): ...@@ -406,8 +406,8 @@ class DB(TM):
self.db.query(query) self.db.query(query)
except ProgrammingError, exception: except ProgrammingError, exception:
LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,)) LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,))
if exception[0] == 1064: if exception[0] == ER.PARSE_ERROR:
# 1064 = You have an error in your SQL syntax # You have an error in your SQL syntax
# Replace MySQL brain dead error message with a more meaningful # Replace MySQL brain dead error message with a more meaningful
# one. (MySQL only reports the SQL query *from* the error place, # one. (MySQL only reports the SQL query *from* the error place,
# which strips important contextual information). # which strips important contextual information).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment