API Special Interest Group/Current Design/Errors
< API Special Interest Group | Current Design(Redirected from API Working Group/Current Design/Errors)
Contents
Analysis
It's very inconsistent as to what you're going to get back when an error occurs in an OpenStack service. There's everything from only a status code to JSON to plain text.
Note: No services seem to respond with a top-level "errors" key.
Current Design
The test to get an error was simply doing a GET for a resource that didn't exist. Hence all of the 404 errors below. The number of errors collected below is certainly not exhaustive but, even so, it clearly shows how inconsistent errors are.
Compute
Status Code: 404
{ "itemNotFound": { "message": "Instance could not be found", "code": 404 } }
Identity
Status Code: 404
{ "error": { "message": "Could not find user: does_not_exist", "code": 404, "title": "Not Found" } }
Image
Status Code: 404
404 Not Found The resource could not be found. Image with identifier does_not_exist not found
Network
Status Code: 404
404 Not Found The resource could not be found.
Orchestration
Status Code: 404
{ "explanation": "The resource could not be found.", "code": 404, "error": { "message": "The Stack (does_not_exist) could not be found.", "traceback": "Traceback (most recent call last):\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 69, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 432, in identify_stack\n raise exception.StackNotFound(stack_name=stack_name)\n\nStackNotFound: The Stack (does_not_exist) could not be found.\n", "type": "StackNotFound" }, "title": "Not Found" }
Volume
Status Code: 404
{ "itemNotFound": { "message": "Volume could not be found", "code": 404 } }