[MERGE][Bug #30620] Nicer error message if a plugin is disabled or not installed

Robert Collins robertc at robertcollins.net
Fri Nov 9 13:27:06 GMT 2007


On Fri, 2007-11-09 at 13:19 +0000, Daniel Watkins wrote:
> The attached adds a couple of blackbox tests for hooks (in the new
> blackbox.test_hooks).  I've used the existing errors.UnknownHook so the
> message given has changed from a traceback with:
>   AttributeError: 'module' object has no attribute 'non_existant'
> to:
>   bzr: ERROR: The post commit hook 'bzrlib.non_existant' is unknown in
> this version of bzrlib.

bb:reject

There are a few reasons here.

Firstly, the try:except block is too large - an Attribute error within a
hook will be reported as UnknownHook rather than raised - which is
misleading and hard to diagnose as well as masking the real error.

Secondly, I think we can now delete the legacy post_commit configuration
option as it's not needed for plugins anymore - and delete the legacy
hook code completely. It would be good to do this before 1.0.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071110/01f71d3d/attachment.pgp 


More information about the bazaar mailing list