nickva commented on code in PR #5556:
URL: https://github.com/apache/couchdb/pull/5556#discussion_r2127106128


##########
src/ddoc_cache/src/ddoc_cache_entry_validation_funs.erl:
##########
@@ -26,7 +26,17 @@ ddocid(_) ->
     no_ddocid.
 
 recover(DbName) ->
-    {ok, DDocs} = fabric:design_docs(mem3:dbname(DbName)),
+    %% The VDU function is used to validate documents update before
+    %% storing them in the database.
+    %% Raise an error when invalid instead of returning an empty list.
+    DDocs =
+        case fabric:design_docs(mem3:dbname(DbName)) of
+            {ok, Resp} when is_list(Resp) ->
+                Resp;
+            Else ->
+                couch_log:debug("Invalid design docs: ~p~n", [Else]),
+                error({error, Else})

Review Comment:
   This will technically raise `{error, {error, Error}}` or `{error, {ok, 
Error}}` I think? Maybe we can just handle both and just raise the Error part 
so it's just `error(<<"nodedown">>)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to