comparison mercurial/error.py @ 21620:6eaa71b2a3cc

bundle2: introduce a parttype attribute to BundleValueError We will use the Exception for more that just unknown part type.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 28 May 2014 15:51:19 -0700
parents 7568f5c1c801
children b6eb56a9335d
comparison
equal deleted inserted replaced
21619:292331e906d7 21620:6eaa71b2a3cc
101 # bundle2 related errors 101 # bundle2 related errors
102 class BundleValueError(ValueError): 102 class BundleValueError(ValueError):
103 """error raised when bundle2 cannot be processed 103 """error raised when bundle2 cannot be processed
104 104
105 Current main usecase is unsupported part types.""" 105 Current main usecase is unsupported part types."""
106 pass 106
107 def __init__(self, parttype):
108 self.parttype = parttype
109 super(BundleValueError, self).__init__(parttype)
107 110
108 class ReadOnlyPartError(RuntimeError): 111 class ReadOnlyPartError(RuntimeError):
109 """error raised when code tries to alter a part being generated""" 112 """error raised when code tries to alter a part being generated"""
110 pass 113 pass
111 114