nickva commented on code in PR #6190:
URL: https://github.com/apache/couchdb/pull/6190#discussion_r4428806500
##########
src/chttpd/src/chttpd.erl:
##########
@@ -426,7 +426,7 @@ handle_req_after_auth(HandlerKey, HttpReq) ->
fun chttpd_db:handle_request/1
),
AuthorizedReq = chttpd_auth:authorize(
- possibly_hack(HttpReq),
Review Comment:
Since we're removing the hack we should bubble up the "invalid replication"
exceptions better to the users as 4xx errors and not 500s:
So maybe we add a few clauses to error_info:
```erlang
error_info({error, local_endpoints_not_supported}) ->
{400, ~"invalid_replication", ~"local database names are not supported,
use a full URL"};
error_info({error, ~"Missing replicator database" = Reason}) ->
{400, ~"invalid_replication", Reason};
```
To avoid the odd binary as reason we could change that as well (it's in
couch_replicator_parse):
`throw({error, <<"Missing replicator database">>})` -> `throw({error,
missing_replicator_database})` ?
--
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]