Mercurial > hg-stable
comparison mercurial/wireproto.py @ 21617:0cfda08afd24
bundle2: rename UnknownPartError to BundleValueError
We are going to raise exceptions for a wider range of cases: unsupported
mandatory stream and part parameters. We rename the exception with a wider
name.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 28 May 2014 14:22:24 -0700 |
parents | 5e08f3b65510 |
children | 7568f5c1c801 |
comparison
equal
deleted
inserted
replaced
21616:0a8e7f81e8ae | 21617:0cfda08afd24 |
---|---|
801 return pushres(r) | 801 return pushres(r) |
802 | 802 |
803 finally: | 803 finally: |
804 fp.close() | 804 fp.close() |
805 os.unlink(tempname) | 805 os.unlink(tempname) |
806 except bundle2.UnknownPartError, exc: | 806 except bundle2.BundleValueError, exc: |
807 bundler = bundle2.bundle20(repo.ui) | 807 bundler = bundle2.bundle20(repo.ui) |
808 bundler.newpart('B2X:ERROR:UNKNOWNPART', [('parttype', str(exc))]) | 808 bundler.newpart('B2X:ERROR:UNKNOWNPART', [('parttype', str(exc))]) |
809 return streamres(bundler.getchunks()) | 809 return streamres(bundler.getchunks()) |
810 except util.Abort, inst: | 810 except util.Abort, inst: |
811 # The old code we moved used sys.stderr directly. | 811 # The old code we moved used sys.stderr directly. |