Propagate exact binding import error in --trace or --debug mode

Issue #209 duplicate
anatoly techtonik
created an issue

It is hard to troubleshoot binding import errors, especially when Mercurial distribution is frozen. That's why it would be very helpful to get exact import error in --trace or --debug mode instead of generic: {{{ abort: subvertpy 0.7.3 or later required, but not found! }}}

Comments (12)

  1. Dan Villiom Podlaski Christiansen

    I believe you misunderstood me. There are two problems, here: 1) Exception chaining hasn't been implemented in any of the Python versions we support, nor has it in Mercurial. 2) The code where the ImportError is intercepted does not have access to a Mercurial UI instance, which would be necessary for determining whether verbose or debug output is used.

    In order to fix this, you would have to first implement support for exception chaining in Mercurial, and then add support allow hgsubversion to use it.

  2. Dan Villiom Podlaski Christiansen

    Messages such as ‘No module named svn’ or ‘No module named subvertpy’ simply aren't helpful. Instead, we intercept the exception and raise another one with a more helpful message. From my perspective, the vast majority of our users couldn't care less about tracebacks and original exception messages.

    Exception chaining is a technique which allows you to associate one exception with another. It would allow us to improve on error messages, which retaining the original message for exactness. It should be implemented in the Mercurial traceback routines.

  3. anatoly techtonik reporter

    The absolute majority of your Windows users will need to troubleshoot issues with Subversion bindings, but this request is only for advantage to those who know about --trace and --debug.

    In trace or debug mode it is not the message that is important, but the pointer to the exact place where a problem occurred. Re-thrown "user-friendly" message doesn't allow to troubleshoot this point. And this message often change, when, for example - there is 'svn' module, but some '_client' C level dependency is not satisfied.

  4. Augie Fackler repo owner

    We can't go poking for --traceback or --debug flags at module import time - there's no way for us to have a ui.ui object to look, and we're definitely not going to reimplement the flags parsing for that.

    Unless we get a *clear* notion from users that we need something along these lines, I'd rather we didn't spend more time discussing it. I'd welcome some documentation on diagnosing bindings issues for Windows users. I don't know the first thing about Windows, and usually just send people off to talk to the TortoiseHG folks.

  5. Log in to comment