Merge lp:~benji/launchpad/bug-413174 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Benji York |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11548 |
Proposed branch: | lp:~benji/launchpad/bug-413174 |
Merge into: | lp:launchpad |
Diff against target: |
296 lines (+117/-13) 8 files modified
lib/lp/registry/model/milestone.py (+9/-2) lib/lp/registry/model/product.py (+10/-2) lib/lp/registry/stories/webservice/xx-project-registry.txt (+2/-2) lib/lp/registry/tests/test_milestone.py (+2/-0) lib/lp/registry/tests/test_product.py (+2/-2) lib/lp/registry/tests/test_project.py (+35/-2) lib/lp/registry/tests/test_project_milestone.py (+56/-2) versions.cfg (+1/-1) |
To merge this branch: | bzr merge lp:~benji/launchpad/bug-413174 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonard Richardson (community) | Approve | ||
Review via email: mp+34794@code.launchpad.net |
Description of the change
Often times functions have preconditions that must be met for the
functions to operate correctly. When users interact with those
functions via the web interface the precondition checks are often done
by view code. When called via the web service those functions instead
generate exceptions when called without the preconditions being met.
Previously those exceptions would be recorded as an OOPS and propagated
to the client as HTTP 500 errors with unhelpful response bodies.
This branch fixes bug 413174 by taking advantage of the
lazr.restful.
an HTTP 400 error signaling a client error and causes the web service to
generate a response with the error message from the raised exception.
This also means that these client-induced errors will no longer generate
an OOPS.
In the future similar OOPSes that arrise can be given the same
treatment.
The tests added to verify the nice-error-message, non-OOPS producing
effects of this branch are in the TestLaunchpadlibAPI test cases in
lib/lp/
in lib/lp/
bin/test -t TestLaunchpadlibAPI -t TestDuplicatePr
A small bit of whitespace lint was cleaned up in this branch.
Refactor get_last_oops_id and (as recommended by james_w) use assertNoNewOops. Looks good otherwise.