bundle2: use ProgrammingError
authorJun Wu <quark@fb.com>
Sun, 26 Mar 2017 16:57:25 -0700
changeset 31652 4dbef666c6c9
parent 31651 e960eba3581c
child 31653 8defc7d9adae
bundle2: use ProgrammingError
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Sun Mar 26 16:55:56 2017 -0700
+++ b/mercurial/bundle2.py	Sun Mar 26 16:57:25 2017 -0700
@@ -855,7 +855,7 @@
         self._seenparams = set()
         for pname, __ in self._mandatoryparams + self._advisoryparams:
             if pname in self._seenparams:
-                raise RuntimeError('duplicated params: %s' % pname)
+                raise error.ProgrammingError('duplicated params: %s' % pname)
             self._seenparams.add(pname)
         # status of the part's generation:
         # - None: not started,
@@ -913,7 +913,7 @@
     # methods used to generates the bundle2 stream
     def getchunks(self, ui):
         if self._generated is not None:
-            raise RuntimeError('part can only be consumed once')
+            raise error.ProgrammingError('part can only be consumed once')
         self._generated = False
 
         if ui.debugflag:
@@ -1082,7 +1082,7 @@
 
     @property
     def repo(self):
-        raise RuntimeError('no repo access from stream interruption')
+        raise error.ProgrammingError('no repo access from stream interruption')
 
     def gettransaction(self):
         raise TransactionUnavailable('no repo access from stream interruption')