This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/prototype/fdb-layer by this
push:
new bf887c5 Return a 400 error code for an invalid update sequence
bf887c5 is described below
commit bf887c58952f5a2a6a9ba95851befd4d169c3538
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Fri Mar 27 11:29:20 2020 -0400
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 5984361..2641007 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) ->