couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject git commit: maintain the file_exists idiom
Date Wed, 21 Mar 2012 21:43:25 GMT
Updated Branches:
  refs/heads/1.2.x 25e079117 -> af9e1c883


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.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/af9e1c88
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/af9e1c88
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/af9e1c88

Branch: refs/heads/1.2.x
Commit: af9e1c883ca4accb209cccc7ac9d26efa4daf1fd
Parents: 25e0791
Author: Randall Leeds <randall@apache.org>
Authored: Wed Mar 21 14:38:53 2012 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Wed Mar 21 14:38:53 2012 -0700

----------------------------------------------------------------------
 src/couchdb/couch_server.erl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/af9e1c88/src/couchdb/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 1185a20..440af62 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) ->


Mime
View raw message