diff mercurial/error.py @ 21627:3e8bcc90f07c

bundle2: support None parttype in BundleValueError This will be used for errors at the stream level.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 28 May 2014 16:46:58 -0700
parents b6eb56a9335d
children fecead61d222
line wrap: on
line diff
--- a/mercurial/error.py	Tue May 27 12:16:45 2014 -0700
+++ b/mercurial/error.py	Wed May 28 16:46:58 2014 -0700
@@ -102,10 +102,13 @@
 class BundleValueError(ValueError):
     """error raised when bundle2 cannot be processed"""
 
-    def __init__(self, parttype, params=()):
+    def __init__(self, parttype=None, params=()):
         self.parttype = parttype
         self.params = params
-        msg = parttype
+        if self.parttype is None:
+            msg = 'Stream Parameter'
+        else:
+            msg = parttype
         if self.params:
             msg = '%s - %s' % (msg, ', '.join(self.params))
         super(BundleValueError, self).__init__(msg)