isProgrammingError, thanks Alan

This commit is contained in:
mdipierro
2013-08-18 02:09:14 -05:00
parent 28cfd0a0f2
commit aa644ceeb0
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.08.17.11.30.09
Version 2.6.0-development+timestamp.2013.08.18.02.08.22
+7 -1
View File
@@ -684,6 +684,11 @@ class BaseAdapter(ConnectionPool):
return None
return isinstance(exception, self.driver.OperationalError)
def isProgrammingError(self,exception):
if not hasattr(self.driver, "ProgrammingError"):
return None
return isinstance(exception, self.driver.ProgrammingError)
def id_query(self, table):
return table._id != None
@@ -4328,7 +4333,8 @@ class DatabaseStoredFile:
if db.executesql(query):
return True
except Exception, e:
if not db._adapter.isOperationalError(e):
if not (db._adapter.isOperationalError(e) or
db._adapter.isProgrammingError(e)):
raise
# no web2py_filesystem found?
tb = traceback.format_exc()