Commit Graph

10 Commits

Author SHA1 Message Date
d89fa131ab feat(v2/errors): Use more appropriate HTTP status codes for error cases.
This commits adds test coverage for all the error and non-error cases
described below, but only the behavior of the 403, 404 and 412 cases
are changing in this commit.

When setting a key results in a new resource, we asset an HTTP status
code of 201 (aka "Created").

When attempting to get a resource that doesn't exist, we assert an
HTTP status code of 404 (aka "Not Found").

When attempting to delete a directory without dir=true, or a non-empty
directory without recursive=true, but the request is otherwise valid,
we assert an HTTP status code of 403 (aka "Forbidden").

When a precondition (e.g. specified by prevIndex, or prevValue) is not
met, but the request is otherwise syntactically valid, we assert an
HTTP status code of 412 (aka "Precondition Failed").  However,
prevExist is handled slightly differently.  If prevExist=false fails,
then this is treated like a failed precondition, so it should use
PreconditionFailed.  But, if prevExist=true fails, then this is
treated like other requests that require the existence of the
resource, and uses NotFound if the resource doesn't exist.

We continue to assert an HTTP status code of 400 when the request is
syntactically invalid (e.g. when prevIndex=bad_index).
2013-12-21 21:39:19 -05:00
e00296960c test fix tests 2013-12-05 18:16:01 -05:00
fc562bd625 fix tests bump deps 2013-12-01 17:24:30 -05:00
cba2611c68 Renamed configuration parameters. 2013-11-15 00:13:32 -05:00
954217fb73 Fix v1 cluster migration test. 2013-11-12 19:27:29 -05:00
8c6606ed12 Fix TTL migration issue. 2013-11-05 15:57:53 -07:00
d3bfc49b7c Remove leading slash from handlers. 2013-11-04 14:36:20 -07:00
6b5d6ecd8b Cluster migration test. 2013-11-04 13:46:43 -07:00
bf76af8fd1 Update migration. 2013-11-04 13:16:45 -07:00
02abbb6a6c Migration test. 2013-11-03 15:49:00 -07:00