diff options
Diffstat (limited to 'src/couch_replicator/src/couch_replicator_api_wrap.erl')
-rw-r--r-- | src/couch_replicator/src/couch_replicator_api_wrap.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl index ab1de7df9..a21de4242 100644 --- a/src/couch_replicator/src/couch_replicator_api_wrap.erl +++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl @@ -186,7 +186,9 @@ get_missing_revs(#httpdb{} = Db, IdRevs) -> ), {Id, MissingRevs, PossibleAncestors} end, - {ok, lists:map(ConvertToNativeFun, Props)} + {ok, lists:map(ConvertToNativeFun, Props)}; + (ErrCode, _, ErrMsg) when is_integer(ErrCode) -> + {error, {revs_diff_failed, ErrCode, ErrMsg}} end). @@ -408,7 +410,9 @@ update_docs(#httpdb{} = HttpDb, DocList, Options, UpdateType) -> (413, _, _) -> {error, request_body_too_large}; (417, _, Results) when is_list(Results) -> - {ok, bulk_results_to_errors(DocList, Results, remote)} + {ok, bulk_results_to_errors(DocList, Results, remote)}; + (ErrCode, _, ErrMsg) when is_integer(ErrCode) -> + {error, {bulk_docs_failed, ErrCode, ErrMsg}} end). @@ -466,7 +470,9 @@ changes_since(#httpdb{headers = Headers1, timeout = InactiveTimeout} = HttpDb, end, parse_changes_feed(Options, UserFun2, DataStreamFun2) - end) + end); + (ErrCode, _, ErrMsg) when is_integer(ErrCode) -> + throw({retry_limit, {changes_req_failed, ErrCode, ErrMsg}}) end) catch exit:{http_request_failed, _, _, max_backoff} -> |