Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 057cd1f4f452b65201ca1e0960588417e444cf50
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Sep 7 16:38:13 2015 +0200
[frontend][API] added section about errors
---------------------------------------------------------------
.../docs/api_2/source/Resources/project_chroot.rst | 1 -
frontend/docs/api_2/source/index.rst | 28 +++++++++++++++++++-
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/frontend/docs/api_2/source/Resources/project_chroot.rst
b/frontend/docs/api_2/source/Resources/project_chroot.rst
index a4d6829..48288dc 100644
--- a/frontend/docs/api_2/source/Resources/project_chroot.rst
+++ b/frontend/docs/api_2/source/Resources/project_chroot.rst
@@ -48,7 +48,6 @@ List project chroots
GET /api_2/projects/2482/chroots HTTP/1.1
Host:
copr.fedoraproject.org
- Accept: application/json
**Response**
diff --git a/frontend/docs/api_2/source/index.rst b/frontend/docs/api_2/source/index.rst
index f860a63..d7dfcba 100644
--- a/frontend/docs/api_2/source/index.rst
+++ b/frontend/docs/api_2/source/index.rst
@@ -103,7 +103,33 @@ GET requests would return the following structures:
Errors
______
-todo:
+
+To distinguish errors we use standard HTTP codes:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes.
+Additional information may be contained in the response body, it SHOULD have
`application/json` Content-Type.
+Inside json object, there are MUST be key ``message`` with error description,
+additional information MAY be present at key ``data``
+
+ **Example**
+
+ .. sourcecode:: http
+
+ GET /api_2/builds?project_id=999999999 HTTP/1.1
+ Host:
copr.fedoraproject.org
+
+ **Response**
+
+ .. sourcecode:: http
+
+ HTTP/1.1 404 NOT FOUND
+ Content-Type: application/json
+
+ {
+ "message": "Project with id `999999999` not found",
+ "data": {
+ "project_id": 999999999
+ }
+ }
+
.. _BasicAuth:
https://en.wikipedia.org/wiki/Basic_access_authentication
.. _CoprAPI:
https://copr.fedoraproject.org/api