diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-12-07 20:26:32 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-12-07 20:26:32 +0000 |
commit | d3e93e9f7dfdbfcf6eb52688bf9ddeeba53194ea (patch) | |
tree | b1871b097a2e36a29ec487195f23acc30156ee66 /src/couchdb/couch_rep_httpc.erl | |
parent | 23bcb4a09e504d7957dbf3af958e414ba2534e85 (diff) |
Merged revision 1043186 from trunk:
Replicator improvement: send "unauthorized" error message instead of "db_not_found" when a remote endpoint can not be accessed due to authorization.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1043187 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_httpc.erl')
-rw-r--r-- | src/couchdb/couch_rep_httpc.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl index b32e4c77..e3a4c4c9 100644 --- a/src/couchdb/couch_rep_httpc.erl +++ b/src/couchdb/couch_rep_httpc.erl @@ -98,6 +98,8 @@ db_exists(Req, CanonicalUrl, CreateDB) -> {ok, "302", RespHeaders, _} -> RedirectUrl = redirect_url(RespHeaders, Req#http_db.url), db_exists(Req#http_db{url = RedirectUrl}, CanonicalUrl); + {ok, "401", _, _} -> + throw({unauthorized, ?l2b(Url)}); Error -> ?LOG_DEBUG("DB at ~s could not be found because ~p", [Url, Error]), throw({db_not_found, ?l2b(Url)}) |