comparison mercurial/dispatch.py @ 32340:9c023179e8d0

error: add hint to ProgrammingError As the hint isn't shown by the default exception handler, we need to print it manually. I've copied the "** " style from _exceptionwarning().
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 May 2017 15:41:27 +0900
parents bd872f64a8ba
children c942c83ac2ec
comparison
equal deleted inserted replaced
32339:92de09a05d7f 32340:9c023179e8d0
160 msg = _formatargs(req.args) 160 msg = _formatargs(req.args)
161 starttime = util.timer() 161 starttime = util.timer()
162 ret = None 162 ret = None
163 try: 163 try:
164 ret = _runcatch(req) 164 ret = _runcatch(req)
165 except error.ProgrammingError as inst:
166 req.ui.warn(_('** ProgrammingError: %s\n') % inst)
167 if inst.hint:
168 req.ui.warn(_('** (%s)\n') % inst.hint)
169 raise
165 except KeyboardInterrupt as inst: 170 except KeyboardInterrupt as inst:
166 try: 171 try:
167 if isinstance(inst, error.SignalInterrupt): 172 if isinstance(inst, error.SignalInterrupt):
168 msg = _("killed!\n") 173 msg = _("killed!\n")
169 else: 174 else: