nickva commented on a change in pull request #1129: Elixir suite davisp
URL: https://github.com/apache/couchdb/pull/1129#discussion_r164218967
 
 

 ##########
 File path: src/chttpd/src/chttpd_misc.erl
 ##########
 @@ -205,7 +205,14 @@ cancel_replication(PostBody, Ctx) ->
             {error, badrpc};
         Else ->
             % Unclear what to do here -- pick the first error?
-            hd(Else)
+            % Except try ignoring any {error, not_found} responses
+            % because we'll always get two of those
+            case Else -- [{error, not_found}] of
+                [] ->
 
 Review comment:
   Since we do `lists:usort(Res)` above `Else -- [{error, not_found}]` will 
never be []? 
   
   Otherwise it would have hit the `[UniqueReply]` case. So `Else` would have 2 
or more distinct errors in the list. We'd remove the not_found one and 
hopefully the more relevant one is the one that is left.
   
   Something like `hd(Else ? [{error, not_found}])` instead of the hd(Else) in 
original code?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to