Merge lp:~stevenk/launchpad/proper-error-when-searchtasks-orderby into lp:launchpad
Proposed by
Steve Kowalik
on 2012-09-17
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | William Grant on 2012-09-17 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 15970 | ||||
| Proposed branch: | lp:~stevenk/launchpad/proper-error-when-searchtasks-orderby | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
192 lines (+41/-36) 4 files modified
lib/lp/bugs/errors.py (+6/-0) lib/lp/bugs/model/bugtasksearch.py (+14/-7) lib/lp/bugs/model/tests/test_bugtasksearch.py (+3/-2) lib/lp/bugs/tests/test_searchtasks_webservice.py (+18/-27) |
||||
| To merge this branch: | bzr merge lp:~stevenk/launchpad/proper-error-when-searchtasks-orderby | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| William Grant | code | 2012-09-17 | Approve on 2012-09-17 |
|
Review via email:
|
|||
Commit Message
Make searchTasks more friendly to the API by returning 400 Bad Request rather than ValueError/KeyError and OOPSing.
Description of the Change
Currently, if you pass the wrong order_by argument to searchTasks, it will raise an OOPS with a KeyError. Slightly restructure the code and make sure to raise a 400 Bad Request if the argument is wrong. I have also changed all occurances of ValueError in bugtasksearch to be more friendly to the API, but have subclassed ValueError so that existing browser code will cope.
To post a comment you must log in.

I'd hope the test could be moved into an existing class, but otherwise good.