Mercurial > python-hglib
changeset 190:f38bc0569671
client: don't swallow ResponseError inside open()
_readhello() can generate meaningful ResponseError exceptions. However,
open()'s exception handler swallows these, converting them into generic
ServerErrors. Allow the original ResponseErrors to pass through.
author | Gábor Stefanik <gabor.stefanik@nng.com> |
---|---|
date | Mon, 21 Aug 2017 17:06:13 +0200 |
parents | 8054e925d9c7 |
children | 6987d6cd420c |
files | hglib/client.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hglib/client.py Mon Aug 21 17:02:14 2017 +0200 +++ b/hglib/client.py Mon Aug 21 17:06:13 2017 +0200 @@ -259,6 +259,9 @@ self.server = util.popen(self._args, self._env) try: self._readhello() + except error.ResponseError: + self.close() + raise except error.ServerError: ret, serr = self._close() raise error.ServerError('server exited with status %d: %s'