couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1076410 - /couchdb/trunk/src/couchdb/couch_api_wrap.erl
Date Wed, 02 Mar 2011 21:47:55 GMT
Author: fdmanana
Date: Wed Mar  2 21:47:55 2011
New Revision: 1076410

URL: http://svn.apache.org/viewvc?rev=1076410&view=rev
Log:
Throw conflict in the remote clause of couch_api_wrap:update_doc/4

This is to mimic the behaviour of the local database clause of this
function.

Modified:
    couchdb/trunk/src/couchdb/couch_api_wrap.erl

Modified: couchdb/trunk/src/couchdb/couch_api_wrap.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_api_wrap.erl?rev=1076410&r1=1076409&r2=1076410&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_api_wrap.erl (original)
+++ couchdb/trunk/src/couchdb/couch_api_wrap.erl Wed Mar  2 21:47:55 2011
@@ -228,6 +228,8 @@ update_doc(#httpdb{} = HttpDb, #doc{id =
            {headers, Headers}, {body, Body}],
         fun(Code, _, {Props}) when Code =:= 200 orelse Code =:= 201 ->
                 {ok, couch_doc:parse_rev(get_value(<<"rev">>, Props))};
+            (409, _, _) ->
+                throw(conflict);
             (_, _, {Props}) ->
                 {error, get_value(<<"error">>, Props)}
         end);



Mime
View raw message