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:52 GMT
Updated Branches:
  refs/heads/1.1.x e567f110a -> 3e2280bfd


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/3e2280bf
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3e2280bf
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3e2280bf

Branch: refs/heads/1.1.x
Commit: 3e2280bfd5e18983a1509382c4a42834b33bec45
Parents: e567f11
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:43:31 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/3e2280bf/src/couchdb/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 7870d69..957bdcb 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -284,6 +284,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