couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject couch-mrview commit: updated refs/heads/import-master to deec893
Date Wed, 12 Feb 2014 06:18:01 GMT
Updated Branches:
  refs/heads/import-master [created] deec893ba


Send better error if user specifies key and keys

closes COUCHDB-2053


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

Branch: refs/heads/import-master
Commit: deec893baadc2c9b9805df546984fd6436f4f411
Parents: 9f59339
Author: Robert Newson <rnewson@apache.org>
Authored: Fri Feb 7 11:00:24 2014 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Fri Feb 7 14:40:40 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/deec893b/src/couch_mrview_util.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_util.erl b/src/couch_mrview_util.erl
index c4272f8..95f7be4 100644
--- a/src/couch_mrview_util.erl
+++ b/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;


Mime
View raw message