From aa644ceeb0e197e5944ae9020439c6de78b8e98b Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 18 Aug 2013 02:09:14 -0500 Subject: [PATCH] isProgrammingError, thanks Alan --- VERSION | 2 +- gluon/dal.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 09c7ce06..7d55c734 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/dal.py b/gluon/dal.py index 6e7f4431..d061953d 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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()