comparison mercurial/bundle2.py @ 21183:4345274adc4b stable

bundle2: gracefully handle UnknownPartError during unbundle Same as for Abort error, we catch the error, encode it into a bundle2 reply (expected by the client) and stream this reply. The client processing of the error will raise the exception again.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 21 Apr 2014 16:02:03 -0700
parents 372f4772f7a0
children 28d76afa1568
comparison
equal deleted inserted replaced
21182:08c84fd99aac 21183:4345274adc4b
751 def handlereplycaps(op, inpart): 751 def handlereplycaps(op, inpart):
752 """Used to transmit abort error over the wire""" 752 """Used to transmit abort error over the wire"""
753 manargs = dict(inpart.mandatoryparams) 753 manargs = dict(inpart.mandatoryparams)
754 advargs = dict(inpart.advisoryparams) 754 advargs = dict(inpart.advisoryparams)
755 raise util.Abort(manargs['message'], hint=advargs.get('hint')) 755 raise util.Abort(manargs['message'], hint=advargs.get('hint'))
756
757 @parthandler('b2x:error:unknownpart')
758 def handlereplycaps(op, inpart):
759 """Used to transmit unknown part error over the wire"""
760 manargs = dict(inpart.mandatoryparams)
761 raise UnknownPartError(manargs['parttype'])