mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
bundle2: introduce a `params
` attribute to BundleValueError
We'll first use it for unsupported mandatory parameters on parts.
This commit is contained in:
parent
72ac6a7248
commit
e625997ab5
@ -100,13 +100,15 @@ class PushRaced(RuntimeError):
|
||||
|
||||
# bundle2 related errors
|
||||
class BundleValueError(ValueError):
|
||||
"""error raised when bundle2 cannot be processed
|
||||
"""error raised when bundle2 cannot be processed"""
|
||||
|
||||
Current main usecase is unsupported part types."""
|
||||
|
||||
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"""
|
||||
|
Loading…
Reference in New Issue
Block a user