[CalendarServer-changes] [13179] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 7 12:17:56 PDT 2014


Revision: 13179
          http://trac.calendarserver.org//changeset/13179
Author:   sagen at apple.com
Date:     2014-04-07 12:17:56 -0700 (Mon, 07 Apr 2014)
Log Message:
-----------
Avoid propagating an exception when augment does not know about a given record type

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/augment.py
    CalendarServer/trunk/txdav/who/augment.py

Modified: CalendarServer/trunk/twistedcaldav/directory/augment.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/augment.py	2014-04-07 18:47:59 UTC (rev 13178)
+++ CalendarServer/trunk/twistedcaldav/directory/augment.py	2014-04-07 19:17:56 UTC (rev 13179)
@@ -131,6 +131,9 @@
 
         @return: L{Deferred}
         """
+        if recordType not in recordTypesMap:
+            returnValue(None)
+
         recordType = recordTypesMap[recordType]
 
         result = (yield self._lookupAugmentRecord(uid))

Modified: CalendarServer/trunk/txdav/who/augment.py
===================================================================
--- CalendarServer/trunk/txdav/who/augment.py	2014-04-07 18:47:59 UTC (rev 13178)
+++ CalendarServer/trunk/txdav/who/augment.py	2014-04-07 19:17:56 UTC (rev 13179)
@@ -257,12 +257,11 @@
         if record is None:
             returnValue(None)
 
-        try:
-            augmentRecord = yield self._augmentDB.getAugmentRecord(
-                record.uid,
-                self.recordTypeToOldName(record.recordType)
-            )
-        except KeyError:
+        augmentRecord = yield self._augmentDB.getAugmentRecord(
+            record.uid,
+            self.recordTypeToOldName(record.recordType)
+        )
+        if augmentRecord is None:
             # Augments does not know about this record type, so return
             # the original record
             returnValue(record)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140407/77775119/attachment.html>


More information about the calendarserver-changes mailing list