[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - Connection.py:1.35.68.1

Chris Withers chrisw at nipltd.com
Wed Sep 24 10:31:54 EDT 2003


Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv15110/lib/python/Shared/DC/ZRDB

Modified Files:
      Tag: Zope-2_7-branch
	Connection.py 
Log Message:
 changed some bare try: except:'s in Shared.DC.ZRDB.Connection
       so that they now log exceptions that occur.

=== Zope/lib/python/Shared/DC/ZRDB/Connection.py 1.35 => 1.35.68.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/Connection.py:1.35	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/Connection.py	Wed Sep 24 10:31:53 2003
@@ -23,6 +23,8 @@
 from Aqueduct import custom_default_report
 from cStringIO import StringIO
 from Results import Results
+from sys import exc_info
+from zLOG import LOG, ERROR
 import DocumentTemplate, RDB
 
 class Connection(
@@ -63,7 +65,11 @@
         Globals.Persistent.__setstate__(self, state)
         if self.connection_string:
             try: self.connect(self.connection_string)
-            except: pass
+            except:
+                LOG('Shared.DC.ZRDB.Connection',
+                    ERROR,
+                    'Error connecting to relational database.',
+                    error=exc_info())
 
     def title_and_id(self):
         s=Connection.inheritedAttribute('title_and_id')(self)
@@ -139,7 +145,11 @@
     def manage_close_connection(self, REQUEST):
         " "
         try: self._v_database_connection.close()
-        except: pass
+        except:
+            LOG('Shared.DC.ZRDB.Connection',
+                ERROR,
+                'Error closing relational database connection.',
+                error=exc_info())
         self._v_connected=''
         return self.manage_main(self, REQUEST)
 
@@ -160,7 +170,11 @@
 
     def connect(self,s):
         try: self._v_database_connection.close()
-        except: pass
+        except:
+            LOG('Shared.DC.ZRDB.Connection',
+                ERROR,
+                'Error closing relational database connection.',
+                error=exc_info())
         self._v_connected=''
         DB=self.factory()
         try:




More information about the Zope-Checkins mailing list