[CalendarServer-changes] [2052] CalendarServer/trunk/twistedcaldav/sql.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 6 17:15:17 PST 2007


Revision: 2052
          http://trac.macosforge.org/projects/calendarserver/changeset/2052
Author:   wsanchez at apple.com
Date:     2007-12-06 17:15:14 -0800 (Thu, 06 Dec 2007)

Log Message:
-----------
log en error when a database can't be opened which let's us know which database is having trouble.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/sql.py

Modified: CalendarServer/trunk/twistedcaldav/sql.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/sql.py	2007-12-07 01:13:40 UTC (rev 2051)
+++ CalendarServer/trunk/twistedcaldav/sql.py	2007-12-07 01:15:14 UTC (rev 2052)
@@ -70,10 +70,14 @@
         """
         if not hasattr(self, "_db_connection"):
             db_filename = self.dbpath
-            if self.autocommit:
-                self._db_connection = sqlite.connect(db_filename, isolation_level=None)
-            else:
-                self._db_connection = sqlite.connect(db_filename)
+            try:
+                if self.autocommit:
+                    self._db_connection = sqlite.connect(db_filename, isolation_level=None)
+                else:
+                    self._db_connection = sqlite.connect(db_filename)
+            except:
+                log.err("Unable to open database: %s" % (db_filename,))
+                raise
 
             #
             # Set up the schema

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20071206/36cfd73b/attachment.html


More information about the calendarserver-changes mailing list