debug: use InputError instead of CommandError for validating arguments
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 31 May 2023 11:30:33 -0300
changeset 50577 2f5270af57c7
parent 50576 dc201a09e82c
child 50578 003418163195
debug: use InputError instead of CommandError for validating arguments
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Fri May 26 17:41:25 2023 +0200
+++ b/mercurial/debugcommands.py	Wed May 31 11:30:33 2023 -0300
@@ -711,10 +711,10 @@
     opts = pycompat.byteskwargs(opts)
     if opts.get(b'changelog') or opts.get(b'manifest') or opts.get(b'dir'):
         if rev is not None:
-            raise error.CommandError(b'debugdata', _(b'invalid arguments'))
+            raise error.InputError(_(b'invalid arguments'))
         file_, rev = None, file_
     elif rev is None:
-        raise error.CommandError(b'debugdata', _(b'invalid arguments'))
+        raise error.InputError(_(b'invalid arguments'))
     r = cmdutil.openstorage(repo, b'debugdata', file_, opts)
     try:
         ui.write(r.rawdata(r.lookup(rev)))
@@ -2632,7 +2632,7 @@
     """write and inspect on disk nodemap"""
     if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
         if file_ is not None:
-            raise error.CommandError(b'debugnodemap', _(b'invalid arguments'))
+            raise error.InputError(_(b'invalid arguments'))
     elif file_ is None:
         opts['changelog'] = True
     r = cmdutil.openstorage(
@@ -3561,10 +3561,10 @@
     opts = pycompat.byteskwargs(opts)
     if opts.get(b'changelog') or opts.get(b'manifest') or opts.get(b'dir'):
         if rev is not None:
-            raise error.CommandError(b'debugdata', _(b'invalid arguments'))
+            raise error.InputError(_(b'invalid arguments'))
         file_, rev = None, file_
     elif rev is None:
-        raise error.CommandError(b'debugdata', _(b'invalid arguments'))
+        raise error.InputError(_(b'invalid arguments'))
     r = cmdutil.openstorage(repo, b'debugdata', file_, opts)
     r = getattr(r, '_revlog', r)
     try: