summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2020-03-27 11:29:20 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2020-03-27 12:39:08 -0400
commitbf887c58952f5a2a6a9ba95851befd4d169c3538 (patch)
tree2e1f0d56fac49198b38804c2c087ebb27105ecf2
parentefe53e41aefa3a320bb6560f80bcffbae69bb33e (diff)
downloadcouchdb-bf887c58952f5a2a6a9ba95851befd4d169c3538.tar.gz
Return a 400 error code for an invalid update sequence
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) ->