Unhelpful error on badly declared API export
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lazr.restful |
Fix Released
|
Low
|
Benji York |
Bug Description
Recently, didrocks & I were trying to expose GPG keys via the API.
As part of an early attempt, we accidentally said that IPerson.gpgkeys was a list of IGPGKeySets rather than IGPGKeys.
That is, we wrote:
gpg_keys = exported(
Rather than:
gpg_keys = exported(
When we tried to test this (a step which demanded building the wadl & apidocs first), we got an obsure error: ` AssertionError: No IEntry adapter found for IGPGKeySet (web service version: devel).`
The error gave no hint of which declaration was causing the problems, not even which file the bad declaration was in, so we spent a lot of time trying to expose IGPGKeySet as a collection.
It would be very useful if the error message included some reference to the declaration that causes the problems. Bonus points for not being an assertion error.
Related branches
- Edwin Grubbs (community): Approve (code)
-
Diff: 119 lines (+59/-6)3 files modifiedsrc/lazr/restful/_resource.py (+18/-3)
src/lazr/restful/tales.py (+9/-2)
src/lazr/restful/tests/test_error.py (+32/-1)
Changed in launchpad-foundations: | |
assignee: | nobody → Benji York (benji) |
status: | Triaged → In Progress |
Changed in launchpad-foundations: | |
status: | In Progress → Fix Committed |
affects: | launchpad → lazr.restful |
tags: | added: qa-untestable |
Changed in lazr.restful: | |
status: | Fix Committed → Fix Released |
FWIW, I added this to my list of things to talk to Jonathan Lange about to possible start soon.