summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Leeds <randall@apache.org>2012-03-21 14:38:53 -0700
committerRandall Leeds <randall@apache.org>2012-03-21 14:38:53 -0700
commitaf9e1c883ca4accb209cccc7ac9d26efa4daf1fd (patch)
treeb18b0ffbc3969f6336e751071a6a11981c124cc6
parent25e079117218b52c18d51dca0810b974ec80ff8a (diff)
downloadcouchdb-af9e1c883ca4accb209cccc7ac9d26efa4daf1fd.tar.gz
maintain the file_exists idiom
POSIX {error, eexist} from the file module needs to be kept from bubbling all the way to couch_httpd or it will result in a 500 error when a 412 is what we want. This change confines all the "database exists already" conversion of the {error, eexist} that now bubble out of couch_file contained within couch_server.
-rw-r--r--src/couchdb/couch_server.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 1185a20d1..440af6292 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -323,6 +323,8 @@ handle_call({open_result, DbName, {ok, OpenedDbPid}, Options}, _From, Server) ->
ok
end,
{reply, ok, Server};
+handle_call({open_result, DbName, {error, eexist}, Options}, From, Server) ->
+ handle_call({open_result, DbName, file_exists, Options}, From, Server);
handle_call({open_result, DbName, Error, Options}, _From, Server) ->
[{DbName, {opening,Opener,Froms}}] = ets:lookup(couch_dbs_by_name, DbName),
lists:foreach(fun(From) ->