changeset 36840:ef68493d652b

wireproto: raise ProgrammingError instead of Abort This isn't a user-facing error and can only be caused by bad Python code. Thanks to Yuya for spotting this. Differential Revision: https://phab.mercurial-scm.org/D2777
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 10 Mar 2018 10:27:56 -0800
parents 5b9ae9eca94a
children 9c636ec1ef37
files mercurial/wireproto.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireproto.py	Sat Mar 10 19:56:47 2018 +0900
+++ b/mercurial/wireproto.py	Sat Mar 10 10:27:56 2018 -0800
@@ -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,