[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex - TopicIndex.py:1.10

Andreas Jung andreas@andreas-jung.com
Thu, 28 Nov 2002 11:32:03 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex
In directory cvs.zope.org:/tmp/cvs-serv5613/lib/python/Products/PluginIndexes/TopicIndex

Modified Files:
	TopicIndex.py 
Log Message:
- removed duplicate tests
- logging an error message instead of raising an exception in case of 
  unindex_object() failure


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 1.9 => 1.10 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py:1.9	Wed Aug 14 18:19:34 2002
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py	Thu Nov 28 11:32:02 2002
@@ -21,6 +21,7 @@
 from Acquisition import Implicit
 from BTrees.OOBTree import OOBTree
 from BTrees.IIBTree import IISet,intersection,union
+from zLOG import ERROR, LOG
 import FilteredSet
 
 _marker = []
@@ -75,8 +76,13 @@
         """ hook for (Z)Catalog """
 
         for fs in self.filteredSets.values():
-            fs.unindex_object(documentId)
 
+            try:
+                fs.unindex_object(documentId)
+            except KeyError:
+                LOG(self.__class__.__name__, ERROR,
+                    'Attempt to unindex document'
+                    ' with id %s failed' % documentId)
         return 1