Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F83317636 for ; Mon, 7 Sep 2015 12:44:29 +0000 (UTC) Received: (qmail 2716 invoked by uid 500); 7 Sep 2015 12:44:13 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 2668 invoked by uid 500); 7 Sep 2015 12:44:13 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 2659 invoked by uid 99); 7 Sep 2015 12:44:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2015 12:44:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5A280DFFBF; Mon, 7 Sep 2015 12:44:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Message-Id: <119c9cd886074abb8bf56f05c3f53c5c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: couch-index commit: updated refs/heads/master to 6565cb9 Date: Mon, 7 Sep 2015 12:44:13 +0000 (UTC) Repository: couchdb-couch-index Updated Branches: refs/heads/master d54810000 -> 6565cb961 Throw validation error in all cases This clarifies the validation contract; we always throw if there's a problem with the design document. COUCHDB-2772 Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/6565cb96 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/6565cb96 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/6565cb96 Branch: refs/heads/master Commit: 6565cb961a8da21b21d213e4981133e119bb5ff1 Parents: d548100 Author: Robert Newson Authored: Mon Sep 7 13:07:57 2015 +0100 Committer: Robert Newson Committed: Mon Sep 7 13:07:57 2015 +0100 ---------------------------------------------------------------------- src/couch_index_server.erl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/6565cb96/src/couch_index_server.erl ---------------------------------------------------------------------- diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl index 0f18c0b..abb4b7a 100644 --- a/src/couch_index_server.erl +++ b/src/couch_index_server.erl @@ -54,17 +54,11 @@ validate(DbName, DDoc) -> [] end, ValidateFun = fun - (ModName, ok) -> - try - ModName:validate(DbName, DDoc) - catch Type:Reason -> - {Type, Reason} - end; - (_ModName, Error) -> - Error + (ModName) -> + ModName:validate(DbName, DDoc) end, EnabledIndexers = lists:flatmap(LoadModFun, config:get("indexers")), - lists:foldl(ValidateFun, ok, EnabledIndexers). + lists:foreach(ValidateFun, EnabledIndexers). get_index(Module, #db{name = <<"shards/", _/binary>> = DbName}, DDoc) ->