mercurial/wireproto.py
branchstable
changeset 21183 4345274adc4b
parent 21177 952af771bc17
child 21184 28d76afa1568
--- a/mercurial/wireproto.py	Tue Apr 22 11:41:34 2014 -0700
+++ b/mercurial/wireproto.py	Mon Apr 21 16:02:03 2014 -0700
@@ -803,6 +803,12 @@
         finally:
             fp.close()
             os.unlink(tempname)
+    except bundle2.UnknownPartError, exc:
+            bundler = bundle2.bundle20(repo.ui)
+            part = bundle2.bundlepart('B2X:ERROR:UNKNOWNPART',
+                                      [('parttype', str(exc))])
+            bundler.addpart(part)
+            return streamres(bundler.getchunks())
     except util.Abort, inst:
         # The old code we moved used sys.stderr directly.
         # We did not change it to minimise code change.