REST Error handling (#299)

* Use HTTPStatus for all responses

More informative than just the code as an int

* Fill out REST error handling

* Test error routes

* Use HTTP Status for tests too

* factor mime type request into function

* Better mimetype errors

* 404 -> 400 error for bad key
This commit is contained in:
Charlotte Weaver
2018-10-08 14:17:56 -07:00
committed by GitHub
parent 8be0833d23
commit 11ef5ae51b
4 changed files with 193 additions and 81 deletions
+2 -3
View File
@@ -300,7 +300,7 @@ Observations and variables are guaranteed to have a `name` annotation, which sho
**Response code:**
- 200 Success
- 404 Not Found - one or more of the names specified with `annotation-name` are not associated with an annotation.
- 400 Bad Request - one or more of the names specified with `annotation-name` are not associated with an annotation.
**Response body:** annotation description and values. Values conform to the schema returned by `/schema` and each record begins with the observation or variable index. Where the specific value is not defined, `null`will be returned. Values will be sorted by index.
@@ -342,8 +342,7 @@ Same as the `GET /annotations` routes, with additional ability to filter by obse
**Response code:**
- 200 Success
- 400 Bad Request - malformed filter
- 404 Not Found - one or more of the annotation-name identifiers were not associated with an annotation name.
- 400 Bad Request - malformed filter or one or more of the annotation-name identifiers were not associated with an annotation name.
**Response body:**