##// END OF EJS Templates
errors: name arguments to CommandError constructor...
Martin von Zweigbergk -
r46270:bd2df583 default
parent child Browse files
Show More
@@ -492,13 +492,13 def _callcatch(ui, func):
492 492 % (inst.args[0], b" ".join(inst.args[1]))
493 493 )
494 494 except error.CommandError as inst:
495 if inst.args[0]:
495 if inst.command:
496 496 ui.pager(b'help')
497 msgbytes = pycompat.bytestr(inst.args[1])
498 ui.warn(_(b"hg %s: %s\n") % (inst.args[0], msgbytes))
499 commands.help_(ui, inst.args[0], full=False, command=True)
497 msgbytes = pycompat.bytestr(inst.message)
498 ui.warn(_(b"hg %s: %s\n") % (inst.command, msgbytes))
499 commands.help_(ui, inst.command, full=False, command=True)
500 500 else:
501 ui.warn(_(b"hg: %s\n") % inst.args[1])
501 ui.warn(_(b"hg: %s\n") % inst.message)
502 502 ui.warn(_(b"(use 'hg help -v' for a list of global options)\n"))
503 503 except error.ParseError as inst:
504 504 _formatparse(ui.warn, inst)
@@ -100,6 +100,11 class ManifestLookupError(LookupError):
100 100 class CommandError(Exception):
101 101 """Exception raised on errors in parsing the command line."""
102 102
103 def __init__(self, command, message):
104 self.command = command
105 self.message = message
106 super(CommandError, self).__init__()
107
103 108 __bytes__ = _tobytes
104 109
105 110
General Comments 0
You need to be logged in to leave comments. Login now