D2777: wireproto: raise ProgrammingError instead of Abort
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Sat Mar 10 18:28:34 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This isn't a user-facing error and can only be caused by bad
Python code.
Thanks to Yuya for spotting this.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2777
AFFECTED FILES
mercurial/wireproto.py
CHANGE DETAILS
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -704,12 +704,13 @@
transports = {k for k, v in wireprototypes.TRANSPORTS.items()
if v['version'] == 2}
else:
- raise error.Abort(_('invalid transport policy value: %s') %
- transportpolicy)
+ raise error.ProgrammingError('invalid transport policy value: %s' %
+ transportpolicy)
if permission not in ('push', 'pull'):
- raise error.Abort(_('invalid wire protocol permission; got %s; '
- 'expected "push" or "pull"') % permission)
+ raise error.ProgrammingError('invalid wire protocol permission; '
+ 'got %s; expected "push" or "pull"' %
+ permission)
def register(func):
commands[name] = commandentry(func, args=args, transports=transports,
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list