From a340de8c1eb9898e41b409a80a8ab4b0897e2283 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 23 Jul 2013 08:41:53 -0500 Subject: [PATCH] better solution 1602, thanks Alan --- VERSION | 2 +- gluon/dal.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1e9bc0d6..28446fd5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.07.23.02.04.35 +Version 2.6.0-development+timestamp.2013.07.23.08.39.39 diff --git a/gluon/dal.py b/gluon/dal.py index bccd14aa..eb4cf079 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -679,6 +679,11 @@ class BaseAdapter(ConnectionPool): 'big-reference': 'BIGINT REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s', } + def isOperationalError(self,exception): + if not hasattr(self.driver, "OperationalError"): + return None + return isinstance(exception, self.driver.OperationalError) + def id_query(self, table): return table._id != None @@ -4324,7 +4329,9 @@ class DatabaseStoredFile: try: if db.executesql(query): return True - except Exception: + except Exception, e: + if not db._adapter.isOperationalError(e): + raise # no web2py_filesystem found? tb = traceback.format_exc() LOGGER.error("Could not retrieve %s\n%s" % (filename, tb))