From 688cf651f9b7867bd54e80ac978c8827eea698b9 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 21 Sep 2009 20:29:22 +0000 Subject: attempt at gentler replication shutdown when one of the DBs is deleted git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@817403 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_writer.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_rep_writer.erl') diff --git a/src/couchdb/couch_rep_writer.erl b/src/couchdb/couch_rep_writer.erl index d88c3ee2..ffe9768f 100644 --- a/src/couchdb/couch_rep_writer.erl +++ b/src/couchdb/couch_rep_writer.erl @@ -46,12 +46,18 @@ writer_loop(Parent, Reader, Target) -> write_docs(#http_db{} = Db, Docs) -> JsonDocs = [couch_doc:to_json_obj(Doc, [revs,attachments]) || Doc <- Docs], - ErrorsJson = couch_rep_httpc:request(Db#http_db{ + Request = Db#http_db{ resource = "_bulk_docs", method = post, body = {[{new_edits, false}, {docs, JsonDocs}]}, headers = [{"x-couch-full-commit", "false"} | Db#http_db.headers] - }), + }, + ErrorsJson = case couch_rep_httpc:request(Request) of + {FailProps} -> + exit({target_error, proplists:get_value(<<"error">>, FailProps)}); + List when is_list(List) -> + List + end, ErrorsList = lists:map( fun({Props}) -> -- cgit v1.2.3