From 0f838aa121a7b6d65506d4fb35e7a1d66420b5e5 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Fri, 27 Mar 2020 11:29:20 -0400 Subject: 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 } ``` --- src/chttpd/src/chttpd.erl | 2 ++ 1 file changed, 2 insertions(+) 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) -> -- cgit v1.2.1