summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep_httpc.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-12-07 20:27:13 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-12-07 20:27:13 +0000
commita8fc23aeac3145c5c0d0840beb3d27365bd202bf (patch)
tree19e9275df19126927a5d48f723f37806b7c5c623 /src/couchdb/couch_rep_httpc.erl
parent2d591fd1e45338215d1bdebd84884d8044779327 (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.1.x@1043188 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_httpc.erl')
-rw-r--r--src/couchdb/couch_rep_httpc.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl
index 75bc5cc7..7a5bd18b 100644
--- a/src/couchdb/couch_rep_httpc.erl
+++ b/src/couchdb/couch_rep_httpc.erl
@@ -103,6 +103,8 @@ db_exists(Req, CanonicalUrl, CreateDB) ->
{ok, "303", RespHeaders, _} ->
RedirectUrl = redirect_url(RespHeaders, Req#http_db.url),
db_exists(Req#http_db{method = get, 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)})