Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 48FEB108F8 for ; Thu, 3 Oct 2013 18:48:28 +0000 (UTC) Received: (qmail 24738 invoked by uid 500); 3 Oct 2013 18:48:25 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 24398 invoked by uid 500); 3 Oct 2013 18:48:22 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 24058 invoked by uid 99); 3 Oct 2013 18:48:19 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Oct 2013 18:48:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 34A1890ED24; Thu, 3 Oct 2013 18:48:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: djc@apache.org To: commits@couchdb.apache.org Date: Thu, 03 Oct 2013 18:48:26 -0000 Message-Id: <66d2ebdd4045415e8275d0b1f61bd20e@git.apache.org> In-Reply-To: <9d3721ba72db4f6a821435db2e286c7b@git.apache.org> References: <9d3721ba72db4f6a821435db2e286c7b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [08/10] git commit: updated refs/heads/master to 4ca2cec Be a bit nicer about logging Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a72d1f9c Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a72d1f9c Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a72d1f9c Branch: refs/heads/master Commit: a72d1f9c895ddfed00f27820a9b46e17d50515c9 Parents: 37aa350 Author: Adam Kocoloski Authored: Wed Oct 2 15:25:57 2013 -0400 Committer: Adam Kocoloski Committed: Wed Oct 2 15:35:54 2013 -0400 ---------------------------------------------------------------------- src/couch_replicator/src/couch_replicator_api_wrap.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/a72d1f9c/src/couch_replicator/src/couch_replicator_api_wrap.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl index f779747..eb7d845 100644 --- a/src/couch_replicator/src/couch_replicator_api_wrap.erl +++ b/src/couch_replicator/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(