Merge lp://qastaging/~jr/bzr/274578-smart-server-hookable-error-logging into lp://qastaging/bzr

Proposed by Jonathan Riddell
Status: Merged
Approved by: Jonathan Riddell
Approved revision: no longer in the source branch.
Merged at revision: 5927
Proposed branch: lp://qastaging/~jr/bzr/274578-smart-server-hookable-error-logging
Merge into: lp://qastaging/bzr
Diff against target: 94 lines (+35/-4)
3 files modified
bzrlib/smart/server.py (+12/-3)
bzrlib/tests/blackbox/test_serve.py (+19/-1)
doc/en/release-notes/bzr-2.4.txt (+4/-0)
To merge this branch: bzr merge lp://qastaging/~jr/bzr/274578-smart-server-hookable-error-logging
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Review via email: mp+62135@code.qastaging.launchpad.net

Commit message

New hook server_exception in bzrlib.smart.server to catch any exception caused while running bzr serve. (Jonathan Riddell, #274578)

Description of the change

Add "server_exception" hook for bug 61728. When an exception occurs it calls the hook with sys.exc_info(). If the hook returns false or there is no hook is raises the exception as normal.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Looks good, thanks !

One small nit:

70 + args = []
71 + out, err = self.run_bzr_serve_then_func(args, retcode=3)

This checks that the server dies when no hook is installed (before testing the hook itself).

It would be even better to do that in a separate test to get a better defect localization (see http://xunitpatterns.com/Goals%20of%20Test%20Automation.html).

You also need to add a news entry (make sure to remerge trunk so you get the right section in the release-notes file).

BB:tweak ;)

review: Needs Fixing
Revision history for this message
Jonathan Riddell (jr) wrote :

sent to pqm by email

Revision history for this message
Jonathan Riddell (jr) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.