Mercurial > public > mercurial-scm > hg
diff mercurial/wireprotov1server.py @ 45682:d2e1dcd4490d
errors: name arguments to Abort constructor
Differential Revision: https://phab.mercurial-scm.org/D9179
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 08 Oct 2020 13:37:31 -0700 |
parents | c93dd9d9f1e6 |
children | 74271829ddc0 |
line wrap: on
line diff
--- a/mercurial/wireprotov1server.py Thu Oct 08 15:35:44 2020 -0700 +++ b/mercurial/wireprotov1server.py Thu Oct 08 13:37:31 2020 -0700 @@ -497,11 +497,11 @@ # cleanly forward Abort error to the client if not exchange.bundle2requested(opts.get(b'bundlecaps')): if proto.name == b'http-v1': - return wireprototypes.ooberror(pycompat.bytestr(exc) + b'\n') + return wireprototypes.ooberror(exc.message + b'\n') raise # cannot do better for bundle1 + ssh # bundle2 request expect a bundle2 reply bundler = bundle2.bundle20(repo.ui) - manargs = [(b'message', pycompat.bytestr(exc))] + manargs = [(b'message', exc.message)] advargs = [] if exc.hint is not None: advargs.append((b'hint', exc.hint)) @@ -684,7 +684,7 @@ # We did not change it to minimise code change. # This need to be moved to something proper. # Feel free to do it. - procutil.stderr.write(b"abort: %s\n" % exc) + procutil.stderr.write(b"abort: %s\n" % exc.message) if exc.hint is not None: procutil.stderr.write(b"(%s)\n" % exc.hint) procutil.stderr.flush() @@ -733,7 +733,7 @@ if exc.params: errpart.addparam(b'params', b'\0'.join(exc.params)) except error.Abort as exc: - manargs = [(b'message', stringutil.forcebytestr(exc))] + manargs = [(b'message', exc.message)] advargs = [] if exc.hint is not None: advargs.append((b'hint', exc.hint))