better solution 1602, thanks Alan

This commit is contained in:
mdipierro
2013-07-23 08:41:53 -05:00
parent e6271dd5f1
commit a340de8c1e
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -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
+8 -1
View File
@@ -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))