summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2020-03-27 11:29:20 -0400
committerNick Vatamaniuc <vatamane@apache.org>2020-03-27 11:29:20 -0400
commit0f838aa121a7b6d65506d4fb35e7a1d66420b5e5 (patch)
treeea7d9c81c826598b997ea814a1c74483fa2eac8f
parentd67f5073f935fd971924c8093e2e4b722dfc3439 (diff)
downloadcouchdb-return-400-for-invalid-seq.tar.gz
Return a 400 error code for an invalid update sequencereturn-400-for-invalid-seq
Currently we return a 500 but a 400 return code makes more sense ``` $ http $DB1/db1/_changes?since=0-1345 HTTP/1.1 400 Bad Request { "error": "invalid_since_seq", "reason": "0-1345", "ref": 442671026 } ```
-rw-r--r--src/chttpd/src/chttpd.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 598436153..2641007f7 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -943,6 +943,8 @@ error_info({error, {database_name_too_long, DbName}}) ->
<<"At least one path segment of `", DbName/binary, "` is too long.">>};
error_info({doc_validation, Reason}) ->
{400, <<"doc_validation">>, Reason};
+error_info({invalid_since_seq, Reason}) ->
+ {400, <<"invalid_since_seq">>, Reason};
error_info({missing_stub, Reason}) ->
{412, <<"missing_stub">>, Reason};
error_info(request_entity_too_large) ->