API AssertionError could be adapted to a http code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Unassigned |
Bug Description
OOPS-1318S626 shows that a user tried to create a release for a milestone that had a release. The AssertionError is correct--the author of the script should have checked for the existence of the release before trying to create it. However, this oops does not represent an launchpad application error. We do not think the oops should have been reported in this context. Maybe a 401 or 403 should have been returned.
I think we want to register an adapter for AssertionError on the api host that sets a http code and shows the error message text instead of reporting a oops. The oops exists to tell us that the web app has a programming error, we want users to fix their own scripts.
OOPS-1694EB1486 is another oops that would benefit from such adapter.
Related branches
- Gary Poster: Approve
-
Diff: 363 lines (+208/-31)7 files modifiedsrc/lazr/restful/_resource.py (+40/-25)
src/lazr/restful/configure.zcml (+9/-0)
src/lazr/restful/directives/__init__.py (+1/-1)
src/lazr/restful/error.py (+38/-3)
src/lazr/restful/interfaces/_rest.py (+15/-0)
src/lazr/restful/testing/webservice.py (+17/-2)
src/lazr/restful/tests/test_error.py (+88/-0)
- Leonard Richardson (community): Approve
-
Diff: 296 lines (+117/-13)8 files modifiedlib/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)
Changed in launchpad-foundations: | |
milestone: | 10.03 → 10.04 |
Changed in launchpad-foundations: | |
milestone: | 10.04 → none |
description: | updated |
Changed in launchpad-foundations: | |
milestone: | none → 10.10 |
tags: |
added: qa-needstesting removed: qa-ok |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
Changed in launchpad-registry: | |
status: | Fix Committed → Fix Released |
If adpation is the right way to solve API assertion error oopes in the registry, I think it will automatically fix this problem in all launchpad.