From patchwork Mon Feb 26 13:12:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2448: httppeer: explicitly catch urlerr.httperror and re-raise From: phabricator X-Patchwork-Id: 28396 Message-Id: <749aa73373f4a342967d2cff6893f033@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Mon, 26 Feb 2018 13:12:37 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGefebfa9b4cab: httppeer: explicitly catch urlerr.httperror and re-raise (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2448?vs=6103&id=6120 REVISION DETAIL https://phab.mercurial-scm.org/D2448 AFFECTED FILES mercurial/httppeer.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -439,6 +439,11 @@ if len(vals) < 2: raise error.ResponseError(_("unexpected response:"), r) return vals + except urlerr.httperror: + # Catch and re-raise these so we don't try and treat them + # like generic socket errors. They lack any values in + # .args on Python 3 which breaks our socket.error block. + raise except socket.error as err: if err.args[0] in (errno.ECONNRESET, errno.EPIPE): raise error.Abort(_('push failed: %s') % err.args[1])