summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-07-03 15:34:50 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-07-03 15:34:50 +0000
commit95bebb5efa3302a1baf421b0c740a285982f0419 (patch)
treec2b3816838d0e790915032b65e9f45b21ff2a61b
parentc7117e17bed9cc0dec38264ee31463d5ef56ac4c (diff)
Replacing call couch_httpd_db:couch_doc_open/4 with call to couch_db:open_doc/2.
It's more correct from a design point of view. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@960229 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_auth_cache.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/couchdb/couch_auth_cache.erl b/src/couchdb/couch_auth_cache.erl
index cc835843..bff801fa 100644
--- a/src/couchdb/couch_auth_cache.erl
+++ b/src/couchdb/couch_auth_cache.erl
@@ -392,12 +392,12 @@ ensure_users_db_exists(DbName, Options) ->
end.
ensure_auth_ddoc_exists(Db, DDocId) ->
- try
- couch_httpd_db:couch_doc_open(Db, DDocId, nil, [])
- catch
- _:_Error ->
+ case couch_db:open_doc(Db, DDocId) of
+ {not_found, _Reason} ->
{ok, AuthDesign} = auth_design_doc(DDocId),
- {ok, _Rev} = couch_db:update_doc(Db, AuthDesign, [])
+ {ok, _Rev} = couch_db:update_doc(Db, AuthDesign, []);
+ _ ->
+ ok
end,
ok.