Update the errors guidance to use service-type for code

Also, explain a bit about why errors exist and how the code
can be used.

Change-Id: Idcb4d11f7ff9867dfe29b47dcfd9774ed269ab3e
Closes-Bug: #1756464
This commit is contained in:
Chris Dent 2018-03-21 13:22:50 +00:00
parent e3d4507d10
commit f094748e92
2 changed files with 8 additions and 1 deletions

View File

@ -17,7 +17,7 @@
},
"code": {
"type": "string",
"description": "A service-specific error code. The general form of the code is service-name.error-code. service-name MUST be the service name as defined by the service field of https://git.openstack.org/cgit/openstack/governance/tree/reference/projects.yaml where spaces within the service name are replaced by '-' and if the word 'service' appears in the name, it MUST be omitted. error-code is defined by service project team and MUST only consist of lowercase alpha, numeric, '.', and '-' characters."
"description": "A service-specific error code. The general form of the code is service-type.error-code. service-type MUST be the service type as defined by the service types authority at http://specs.openstack.org/openstack/service-types-authority. error-code is defined by service project team and MUST only consist of lowercase alpha, numeric, '.', and '-' characters."
},
"status": {
"type": "integer",

View File

@ -12,6 +12,13 @@ consistency of the error messages returned to them will play a large part
in how quickly they can learn the API, how they can be more effective with
the API, and how much they enjoy using the API.
This document describes an emerging standard within OpenStack for providing
structured error responses that can be consistently processed and include
coding that will eventually allow errors to be searched for on the web and in
documentation using the value of the ``code`` field. Such codes help to
distinguish the causes of different errors in response to the same HTTP method
and URI, even when the same HTTP status is returned.
Errors JSON Schema
------------------