# HG changeset patch # User Pierre-Yves David # Date 2014-05-28 22:53:34 # Node ID b6eb56a9335d58ed2542de450f7eb71c7d9551f2 # Parent 6eaa71b2a3cca686aa4d47909171d1c208a810e6 bundle2: introduce a ``params`` attribute to BundleValueError We'll first use it for unsupported mandatory parameters on parts. diff --git a/mercurial/error.py b/mercurial/error.py --- a/mercurial/error.py +++ b/mercurial/error.py @@ -100,13 +100,15 @@ class PushRaced(RuntimeError): # bundle2 related errors class BundleValueError(ValueError): - """error raised when bundle2 cannot be processed - - Current main usecase is unsupported part types.""" + """error raised when bundle2 cannot be processed""" - def __init__(self, parttype): + def __init__(self, parttype, params=()): self.parttype = parttype - super(BundleValueError, self).__init__(parttype) + self.params = params + msg = parttype + if self.params: + msg = '%s - %s' % (msg, ', '.join(self.params)) + super(BundleValueError, self).__init__(msg) class ReadOnlyPartError(RuntimeError): """error raised when code tries to alter a part being generated"""