From a8fc23aeac3145c5c0d0840beb3d27365bd202bf Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Tue, 7 Dec 2010 20:27:13 +0000 Subject: 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 --- src/couchdb/couch_rep_httpc.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/couchdb/couch_rep_httpc.erl') 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)}) -- cgit v1.2.3