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
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 @@
[]
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) ->