You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/02/07 15:41:06 UTC

couchdb commit: updated refs/heads/key-vs-keys to 2bc0784

Updated Branches:
  refs/heads/key-vs-keys 427624261 -> 2bc078403 (forced update)


Send better error if user specifies key and keys

closes COUCHDB-2053


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/2bc07840
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/2bc07840
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/2bc07840

Branch: refs/heads/key-vs-keys
Commit: 2bc0784030847cbbdd8998d3f135f91992768f6a
Parents: e7fdc16
Author: Robert Newson <rn...@apache.org>
Authored: Fri Feb 7 11:00:24 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Feb 7 14:40:40 2014 +0000

----------------------------------------------------------------------
 src/couch_mrview/src/couch_mrview_util.erl | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2bc07840/src/couch_mrview/src/couch_mrview_util.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl
index c4272f8..95f7be4 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -359,11 +359,13 @@ validate_args(Args) ->
         _ -> mrverror(<<"`keys` must be an array of strings.">>)
     end,
 
-    case {Args#mrargs.keys, Args#mrargs.start_key} of
-        {undefined, _} -> ok;
-        {[], _} -> ok;
-        {[_|_], undefined} -> ok;
-        _ -> mrverror(<<"`start_key` is incompatible with `keys`">>)
+    case {Args#mrargs.keys, Args#mrargs.start_key,
+          Args#mrargs.end_key} of
+        {undefined, _, _} -> ok;
+        {[], _, _} -> ok;
+        {[_|_], undefined, undefined} -> ok;
+        _ -> mrverror(<<"`keys` is incompatible with `key`"
+                        ", `start_key` and `end_key`">>)
     end,
 
     case Args#mrargs.start_key_docid of
@@ -372,13 +374,6 @@ validate_args(Args) ->
         _ -> mrverror(<<"`start_key_docid` must be a string.">>)
     end,
 
-    case {Args#mrargs.keys, Args#mrargs.end_key} of
-        {undefined, _} -> ok;
-        {[], _} -> ok;
-        {[_|_], undefined} -> ok;
-        _ -> mrverror(<<"`end_key` is incompatible with `keys`">>)
-    end,
-
     case Args#mrargs.end_key_docid of
         undefined -> ok;
         EKDocId0 when is_binary(EKDocId0) -> ok;