You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/09/27 22:09:13 UTC

[GitHub] dynamite-ready edited a comment on issue #1051: Couch return unknown_error / function_clause when create a user with non-string password

dynamite-ready edited a comment on issue #1051: Couch return unknown_error / function_clause when create a user with non-string password
URL: https://github.com/apache/couchdb/issues/1051#issuecomment-425255860
 
 
   I'm not entirely sure if this is directly related to this issue, but I suspect it is, and possibly a few others.
   This code - https://github.com/apache/couchdb/blob/deba7575a1a67fe06850959e99af3e0e9c704443/src/couch/include/couch_erl_functions.hrl#L32:
   
   ```
   true -> throw({forbidden, <<"Only admins may delete other user docs.">>})
   ```
   
   Will throw an `unknown_error` to the log, and return a `500` status code to the frontend.
   
   If instead, I do:
   
   ```
   true -> {[{ <<"forbidden">>, <<"Only admins may delete other user docs.">> }]}
   ```
   
   Then no error appears in the log, but a `403` is returned to the frontend, along with the contents of the second element in the tuple.
   
   This appears to match the clause in the case statement found here - https://github.com/apache/couchdb/blob/master/src/couch/src/couch_query_servers.erl#L379
   
   Might this be related?
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services