[Commits] (morgen) Catch the "import of a bad share" error.

commits at osafoundation.org commits at osafoundation.org
Mon Feb 7 12:31:01 PST 2005


Commit by: morgen
Modified files:
chandler/parcels/osaf/framework/sharing/Sharing.py 1.67 1.68

Log message:
Catch the "import of a bad share" error.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.67&r2=text&tr2=1.68

Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.67 chandler/parcels/osaf/framework/sharing/Sharing.py:1.68
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.67	Mon Feb  7 12:12:55 2005
+++ chandler/parcels/osaf/framework/sharing/Sharing.py	Mon Feb  7 12:31:00 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.67 $"
-__date__ = "$Date: 2005/02/07 20:12:55 $"
+__version__ = "$Revision: 1.68 $"
+__date__ = "$Date: 2005/02/07 20:31:00 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -199,9 +199,12 @@
             # The version is set to -1 to indicate it needs to be
             # set later on (by syncManifestVersions) because we won't
             # know the item version until *after* commit
-            self.__addToManifest(item, data, -1)
-            logger.info("...imported '%s' %s, data: %s" % \
-             (item.getItemDisplayName(), item, data))
+            if item is not None:
+                self.__addToManifest(item, data, -1)
+                logger.info("...imported '%s' %s, data: %s" % \
+                 (item.getItemDisplayName(), item, data))
+            else:
+                logger.info("...NOT able to import '%s'" % itemPath)
             return item
         else:
             pass
@@ -225,6 +228,11 @@
 
         itemPath = self._getItemPath(self.share)
         item = self.__conditionalGetItem(itemPath, into=self.share)
+        if item is None:
+            logger.info("...NOT able to import share")
+            msg = "Not able to sync '%s'\nBad Format" % location
+            raise SharingError(message=msg)
+
         if item is not None:
             retrievedItems.append(item)
         self.__setSeen(itemPath)



More information about the Commits mailing list