You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/06 18:19:07 UTC

[09/26] couch-replicator commit: updated refs/heads/import-rcouch to 589d958

Be a bit nicer about logging


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/eee70d84
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/eee70d84
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/eee70d84

Branch: refs/heads/import-rcouch
Commit: eee70d84d780019cb0a921f0b83f0c904cb07f6a
Parents: b1bf3fb
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Wed Oct 2 15:25:57 2013 -0400
Committer: Adam Kocoloski <ad...@cloudant.com>
Committed: Wed Oct 2 15:35:54 2013 -0400

----------------------------------------------------------------------
 src/couch_replicator_api_wrap.erl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/eee70d84/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_api_wrap.erl b/src/couch_replicator_api_wrap.erl
index f779747..eb7d845 100644
--- a/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator_api_wrap.erl
@@ -222,7 +222,7 @@ open_doc_revs(#httpdb{} = HttpDb, Id, Revs, Options, Fun, Acc) ->
             #httpdb{retries = Retries, wait = Wait0} = HttpDb,
             Wait = 2 * erlang:min(Wait0 * 2, ?MAX_WAIT),
             ?LOG_INFO("Retrying GET to ~s in ~p seconds due to error ~p",
-                [Url, Wait / 1000, Else]
+                [Url, Wait / 1000, error_reason(Else)]
             ),
             ok = timer:sleep(Wait),
             RetryDb = HttpDb#httpdb{
@@ -235,6 +235,14 @@ open_doc_revs(Db, Id, Revs, Options, Fun, Acc) ->
     {ok, Results} = couch_db:open_doc_revs(Db, Id, Revs, Options),
     {ok, lists:foldl(fun(R, A) -> {_, A2} = Fun(R, A), A2 end, Acc, Results)}.
 
+error_reason({http_request_failed, "GET", _Url, {error, timeout}}) ->
+    timeout;
+error_reason({http_request_failed, "GET", _Url, {error, {_, req_timedout}}}) ->
+    req_timedout;
+error_reason({http_request_failed, "GET", _Url, Error}) ->
+    Error;
+error_reason(Else) ->
+    Else.
 
 open_doc(#httpdb{} = Db, Id, Options) ->
     send_req(