Difference between revisions of "API Special Interest Group/Current Design/Errors"
(Created page with "== Compute == Status Code: 404 <pre><nowiki> { "itemNotFound": { "message": "Instance could not be found", "code": 404 } } </nowiki></pre> == Identity == Status...") |
m (EdLeafe moved page API Working Group/Current Design/Errors to API Special Interest Group/Current Design/Errors: +The group changed its name and focus) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | = 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 == | == Compute == | ||
Status Code: 404 | Status Code: 404 | ||
Line 56: | Line 67: | ||
}, | }, | ||
"title": "Not Found" | "title": "Not Found" | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | == Volume == | ||
+ | Status Code: 404 | ||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "message": "Volume could not be found", | ||
+ | "code": 404 | ||
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> |
Latest revision as of 15:40, 14 June 2018
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 } }