Repository: Kinto/kinto

Issue:
documentation: set of error codes not found
At the end of http://kinto.readthedocs.io/en/stable/api/1.x/errors.html#protocol-description, there is a reference `ref:set of errors codes <errors>` that doesn't work.

I've used [core/errors.py](https://github.com/Kinto/kinto/blob/915390dfd3229eea1e36048ee8fcd5b4c4cf11b8/kinto
/core/errors.py) to know what each errno means, but I can't find the information elsewhere in the documentation and don't know how these `ref` instructions work.

So I don't know how to fix this myself...

documentation: set of error codes not found
At the end of http://kinto.readthedocs.io/en/stable/api/1.x/errors.html#protocol-description, there is a reference `ref:set of errors codes <errors>` that doesn't work.

I've used [core/errors.py](https://github.com/Kinto/kinto/blob/915390dfd3229eea1e36048ee8fcd5b4c4cf11b8/kinto
/core/errors.py) to know what each errno means, but I can't find the information elsewhere in the documentation and don't know how these `ref` instructions work.

So I don't know how to fix this myself...



Discussion:
Indeed this https://github.com/Kinto/kinto/blob/master/kinto/core/errors.py#L31-L74 is supposed to be present there: http://kinto.readthedocs.io/en/latest/core/errors.html

Indeed this https://github.com/Kinto/kinto/blob/master/kinto/core/errors.py#L31-L74 is supposed to be present there: http://kinto.readthedocs.io/en/latest/core/errors.html


Resolving patch:
diff --git a/kinto/core/errors.py b/kinto/core/errors.py
--- a/kinto/core/errors.py
+++ b/kinto/core/errors.py
@@ -7,6 +7,50 @@
 
 
 class ERRORS(Enum):
+    """Predefined errors as specified by the API.
+
+    +-------------+-------+------------------------------------------------+
+    | Status code | Errno | Description                                    |
+    +=============+=======+================================================+
+    | 401         | 104   | Missing Authorization Token                    |
+    +-------------+-------+------------------------------------------------+
+    | 401         | 105   | Invalid Authorization Token                    |
+    +-------------+-------+------------------------------------------------+
+    | 400         | 106   | request body was not valid JSON                |
+    +-------------+-------+------------------------------------------------+
+    | 400         | 107   | invalid request parameter                      |
+    +-------------+-------+------------------------------------------------+
+    | 400         | 108   | missing request parameter                      |
+    +-------------+-------+------------------------------------------------+
+    | 400         | 109   | invalid posted data                            |
+    +-------------+-------+------------------------------------------------+
+    | 404         | 110   | Invalid Token / id                             |
+    +-------------+-------+------------------------------------------------+
+    | 404         | 111   | Missing Token / id                             |
+    +-------------+-------+------------------------------------------------+
+    | 411         | 112   | Content-Length header was not provided         |
+    +-------------+-------+------------------------------------------------+
+    | 413         | 113   | Request body too large                         |
+    +-------------+-------+------------------------------------------------+
+    | 412         | 114   | Resource was modified meanwhile                |
+    +-------------+-------+------------------------------------------------+
+    | 405         | 115   | Method not allowed on this end point           |
+    +-------------+-------+------------------------------------------------+
+    | 404         | 116   | Requested version not available on this server |
+    +-------------+-------+------------------------------------------------+
+    | 429         | 117   | Client has sent too many requests              |
+    +-------------+-------+------------------------------------------------+
+    | 403         | 121   | Resource's access forbidden for this user      |
+    +-------------+-------+------------------------------------------------+
+    | 409         | 122   | Another resource violates constraint           |
+    +-------------+-------+------------------------------------------------+
+    | 500         | 999   | Internal Server Error                          |
+    +-------------+-------+------------------------------------------------+
+    | 503         | 201   | Service Temporary unavailable due to high load |
+    +-------------+-------+------------------------------------------------+
+    | 410         | 202   | Service deprecated                             |
+    +-------------+-------+------------------------------------------------+
+    """
     MISSING_AUTH_TOKEN = 104
     INVALID_AUTH_TOKEN = 105
     BADJSON = 106
@@ -28,52 +72,6 @@ class ERRORS(Enum):
     SERVICE_DEPRECATED = 202
 
 
-"""Predefined errors as specified by the API.
-
-+-------------+-------+------------------------------------------------+
-| status code | errno | description                                    |
-+-------------+-------+------------------------------------------------+
-| 401         | 104   | Missing Authorization Token                    |
-+-------------+-------+------------------------------------------------+
-| 401         | 105   | Invalid Authorization Token                    |
-+-------------+-------+------------------------------------------------+
-| 400         | 106   | request body was not valid JSON                |
-+-------------+-------+------------------------------------------------+
-| 400         | 107   | invalid request parameter                      |
-+-------------+-------+------------------------------------------------+
-| 400         | 108   | missing request parameter                      |
-+-------------+-------+------------------------------------------------+
-| 400         | 109   | invalid posted data                            |
-+-------------+-------+------------------------------------------------+
-| 404         | 110   | Invalid Token / id                             |
-+-------------+-------+------------------------------------------------+
-| 404         | 111   | Missing Token / id                             |
-+-------------+-------+------------------------------------------------+
-| 411         | 112   | Content-Length header was not provided         |
-+-------------+-------+------------------------------------------------+
-| 413         | 113   | Request body too large                         |
-+-------------+-------+------------------------------------------------+
-| 412         | 114   | Resource was modified meanwhile                |
-+-------------+-------+------------------------------------------------+
-| 405         | 115   | Method not allowed on this end point           |
-+-------------+-------+------------------------------------------------+
-| 404         | 116   | Requested version not available on this server |
-+-------------+-------+------------------------------------------------+
-| 429         | 117   | Client has sent too many requests              |
-+-------------+-------+------------------------------------------------+
-| 403         | 121   | Resource's access forbidden for this user      |
-+-------------+-------+------------------------------------------------+
-| 409         | 122   | Another resource violates constraint           |
-+-------------+-------+------------------------------------------------+
-| 500         | 999   | Internal Server Error                          |
-+-------------+-------+------------------------------------------------+
-| 503         | 201   | Service Temporary unavailable due to high load |
-+-------------+-------+------------------------------------------------+
-| 410         | 202   | Service deprecated                             |
-+-------------+-------+------------------------------------------------+
-"""
-
-
 def http_error(httpexception, errno=None,
                code=None, error=None, message=None, info=None, details=None):
     """Return a JSON formated response matching the error HTTP API.


Test patch: