iilyak commented on a change in pull request #3481:
URL: https://github.com/apache/couchdb/pull/3481#discussion_r604615363



##########
File path: src/couch_eval/src/couch_eval.erl
##########
@@ -86,6 +94,26 @@ release_map_context({ApiMod, Ctx}) ->
 map_docs({ApiMod, Ctx}, Docs) ->
     ApiMod:map_docs(Ctx, Docs).
 
+-spec acquire_context(language()) -> {ok, context()} | {error, any()}.

Review comment:
       The way function is written it cannot return `{error, any()}`. I think 
the correct spec would be:
   
   ```
   -type error(_Error) :: no_return().
   
   ....
   
   spec acquire_context(language()) -> 
      {ok, context()} 
      | error({invalid_eval_api_mod, Language :: binary()})
      | error({unknown_eval_api_language, Language :: binary()}).
   ```




-- 
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.

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


Reply via email to