Mercurial > hg-git
diff hggit/git_handler.py @ 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 |
parents | 8bb058d6a9ee |
children | 01c9eeedde04 |
line wrap: on
line diff
--- a/hggit/git_handler.py Wed May 18 08:10:00 2011 -0500 +++ b/hggit/git_handler.py Wed May 18 00:31:40 2011 -0700 @@ -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()