[Bug 5289] New: improve exception handling UX

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Jul 8 12:57:00 EDT 2016


            Bug ID: 5289
           Summary: improve exception handling UX
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: timeless at gmail.com
                CC: mercurial-devel at selenic.com

*** failed to import extension rebase: unexpected unindent (rebase.py, line
** Unknown exception encountered with possibly-broken third-party extension
** which supports versions unknown of Mercurial.
** Please disable hgbb and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.8 (default, Oct  7 2015, 09:24:26) [GCC 4.9.2 20150212 (Red Hat
** Mercurial Distributed SCM (version
** Extensions loaded: strip, mq, histedit, color, blackbox, pager, shelve,
topics, remotebranches, evolve, hg-git, chistedit, hgbb, patchbomb
Traceback (most recent call last):
  File "/home/timeless/hg/crew/hg", line 45, in <module>
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 59, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 125, in dispatch
    ret = _runcatch(req)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 204, in _runcatch
    return _dispatch(req)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 742, in _dispatch
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 166, in loadall
    _runuisetup(name, ui)
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 133, in
  File "/home/timeless/hg/topic/hgext3rd/topic/__init__.py", line 94, in
    extensions.afterloaded('rebase', _fixrebase)
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 197, in
  File "/home/timeless/hg/topic/hgext3rd/topic/__init__.py", line 323, in
    rebase = extensions.find("rebase")
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 55, in find
    raise KeyError(name)
KeyError: 'rebase'

I have a slightly modified tip w/ a broken (hgext/rebase.py).

I'm more interested in the poor error handling flow.

The last thing I see is "KeyError: 'rebase'" which isn't helpful.

I'd like to suggest that we stick the suggestion at the end. We should also try
very hard to favor the extension we're loading as opposed to randomly fingering
an extension.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Mercurial-devel mailing list