All text errors reported by the Craton REST API should be JSON encoded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
craton |
Fix Released
|
High
|
git-harry |
Bug Description
This came up recently with a 500 server error with a misconfigured logger; this should have been intercepted in the response chain. So compare:
$ curl http://
A server error occurred. Please contact the administrator.
vs what we usually do:
$ curl http://
{
"message": "Not Found",
"status": 404
}
We may want to further revisit the specific error text as well; see https:/
Changed in craton: | |
assignee: | nobody → git-harry (git-harry) |
Reviewed: https:/ /review. openstack. org/443565 /git.openstack. org/cgit/ openstack/ craton/ commit/ ?id=cbb246111b9 394d3c02843c274 4a5e93c1acebd5
Committed: https:/
Submitter: Jenkins
Branch: master
commit cbb246111b9394d 3c02843c2744a5e 93c1acebd5
Author: git-harry <email address hidden>
Date: Thu Mar 9 09:16:51 2017 +0000
Add http_codes decorator where missing
This commit adds the decorator http_codes to a number of the API put
methods so that all now use it. This ensures any exceptions generated by
the methods return the expected status code and the response body is
JSON encoded.
Change-Id: Id24ef3687afe21 e36adae225efdef 7150b5d5318
Partial-bug: 1665015