summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2022-09-01 15:54:04 +0100
committerRobert Newson <rnewson@apache.org>2022-09-01 15:54:04 +0100
commit187be8f78a54a539e32d92b805d08bfbb3f73dd4 (patch)
treea676b799aea622b511195086fdc8fdf7601c05b8
parentbe93983b927b543e1728c5d50a66429e2c88d229 (diff)
downloadcouchdb-187be8f78a54a539e32d92b805d08bfbb3f73dd4.tar.gz
return a nice error if non-object passed to _bulk_get
-rw-r--r--src/chttpd/src/chttpd_db.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index c41c82347..14049bd78 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -2393,7 +2393,10 @@ throw_bad_query_param(Key) when is_binary(Key) ->
throw({bad_request, Msg}).
bulk_get_open_doc_revs(Db, {Props}, Options) ->
- bulk_get_open_doc_revs1(Db, Props, Options, {}).
+ bulk_get_open_doc_revs1(Db, Props, Options, {});
+bulk_get_open_doc_revs(_Db, _Invalid, Options) ->
+ Error = {null, bad_request, <<"document must be a JSON object">>},
+ {null, {error, Error}, Options}.
bulk_get_open_doc_revs1(Db, Props, Options, {}) ->
case couch_util:get_value(<<"id">>, Props) of