changeset 394:721165a45385

Catch GitProtocolError wherever HangupException can occur. With recent changes to dulwich, this exception occurs in more places.
author Brendan Cully <brendan@kublai.com>
date Wed, 18 May 2011 00:31:40 -0700 (2011-05-18)
parents 15d362677859
children 01c9eeedde04
files hggit/git_handler.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -563,8 +563,8 @@
             self.ui.status(_("creating and sending data\n"))
             changed_refs = client.send_pack(path, changed, genpack)
             return changed_refs
-        except HangupException:
-            raise hgutil.Abort("the remote end hung up unexpectedly")
+        except (HangupException, GitProtocolError), e:
+            raise hgutil.Abort(_("git remote error: ") + str(e))
 
     def get_changed_refs(self, refs, revs, force):
         new_refs = refs.copy()
@@ -673,8 +673,8 @@
             try:
                 return client.fetch_pack(path, determine_wants, graphwalker,
                                          f.write, self.ui.status)
-            except HangupException:
-                raise hgutil.Abort("the remote end hung up unexpectedly")
+            except (HangupException, GitProtocolError), e:
+                raise hgutil.Abort(_("git remote error: ") + str(e))
         finally:
             commit()