Exception mangling in hooks?

Robert Collins robert.collins at canonical.com
Wed Feb 25 22:04:39 GMT 2009


Can anyone explain to me why we mangle exceptions in the
pre_branch_change_hook calling code - it makes it hard to debug why a
hook actually fails, because the entire call stack is relevant, and we
don't do it for other hooks.

I'd like to apply this diff to remove this:

=== modified file 'bzrlib/branch.py'
--- bzrlib/branch.py    2009-02-25 15:36:48 +0000
+++ bzrlib/branch.py    2009-02-25 22:03:59 +0000
@@ -875,15 +875,7 @@
         params = ChangeBranchTipParams(
             self, old_revno, new_revno, old_revid, new_revid)
         for hook in hooks:
-            try:
-                hook(params)
-            except errors.TipChangeRejected:
-                raise
-            except Exception:
-                exc_info = sys.exc_info()
-                hook_name = Branch.hooks.get_hook_name(hook)
-                raise errors.HookFailed(
-                    'pre_change_branch_tip', hook_name, exc_info)
+            hook(params)


-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090226/f97a9e5a/attachment.pgp 


More information about the bazaar mailing list