[Checkins] SVN: zope.fssync/branches/achapman-error-collection/src/zope/fssync/ tweak readability of output

Fred Drake cvs-admin at zope.org
Thu Mar 15 15:24:13 UTC 2012


Log message for revision 124614:
  tweak readability of output

Changed:
  U   zope.fssync/branches/achapman-error-collection/src/zope/fssync/README.txt
  U   zope.fssync/branches/achapman-error-collection/src/zope/fssync/task.py

-=-
Modified: zope.fssync/branches/achapman-error-collection/src/zope/fssync/README.txt
===================================================================
--- zope.fssync/branches/achapman-error-collection/src/zope/fssync/README.txt	2012-03-15 14:36:39 UTC (rev 124613)
+++ zope.fssync/branches/achapman-error-collection/src/zope/fssync/README.txt	2012-03-15 15:24:09 UTC (rev 124614)
@@ -833,8 +833,9 @@
     >>> commit.perform(target, 'root', 'test')
     Traceback (most recent call last):
         ...
-    Exception: 1,2,3
-    1,2,3
+    Exceptions:
+        1,2,3
+        1,2,3
 
     >>> commit.synchNew = old_sync_new
     >>> commit.synchOld = old_sync_old

Modified: zope.fssync/branches/achapman-error-collection/src/zope/fssync/task.py
===================================================================
--- zope.fssync/branches/achapman-error-collection/src/zope/fssync/task.py	2012-03-15 14:36:39 UTC (rev 124613)
+++ zope.fssync/branches/achapman-error-collection/src/zope/fssync/task.py	2012-03-15 15:24:09 UTC (rev 124614)
@@ -162,6 +162,11 @@
             self.dumpMetadata(epath, entries)
 
 
+class Exceptions(Exception):
+    # We use this to pluralize "Exception".
+    pass
+
+
 class Commit(SyncTask):
     """Commit changes from a repository to the object database.
 
@@ -186,7 +191,10 @@
 
         # check for errors
         if self.errors:
-            raise Exception('\n'.join(self.errors))
+            if len(self.errors) == 1:
+                raise Exception(self.errors[0])
+            else:
+                raise Exceptions("\n    ".join([""] + self.errors))
 
         # process callbacks
         passes = 0



More information about the checkins mailing list