--- a/mercurial/bundle2.py Tue May 27 17:04:48 2014 -0500
+++ b/mercurial/bundle2.py Wed May 28 14:22:24 2014 -0700
@@ -172,8 +172,10 @@
"""
return '>'+('BB'*nbparams)
-class UnknownPartError(KeyError):
- """error raised when no handler is found for a Mandatory part"""
+class BundleValueError(ValueError):
+ """error raised when bundle2 cannot be processed
+
+ Current main usecase is unsupported part types."""
pass
class ReadOnlyPartError(RuntimeError):
@@ -307,7 +309,7 @@
if key != parttype: # mandatory parts
# todo:
# - use a more precise exception
- raise UnknownPartError(key)
+ raise BundleValueError(key)
op.ui.debug('ignoring unknown advisory part %r\n' % key)
# consuming the part
part.read()
@@ -839,7 +841,7 @@
@parthandler('b2x:error:unknownpart')
def handlereplycaps(op, inpart):
"""Used to transmit unknown part error over the wire"""
- raise UnknownPartError(inpart.params['parttype'])
+ raise BundleValueError(inpart.params['parttype'])
@parthandler('b2x:error:pushraced')
def handlereplycaps(op, inpart):