summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_show.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-03-04 04:45:10 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-03-04 04:45:10 +0000
commit29ae4670d62db80300483f2362143eb478cf2b56 (patch)
treea62d41f615bf45edd9b7a87233a11d6e715b4ca2 /src/couchdb/couch_httpd_show.erl
parente7eef7dc88643d29913a0b3d053e2e366017a621 (diff)
refactor show 404 handling doc-loading special case out of couch_httpd_db.erl
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@749902 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_show.erl')
-rw-r--r--src/couchdb/couch_httpd_show.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl
index 475f9ae2..398ed4c9 100644
--- a/src/couchdb/couch_httpd_show.erl
+++ b/src/couchdb/couch_httpd_show.erl
@@ -30,7 +30,11 @@ handle_doc_show_req(#httpd{
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, [], []),
Lang = proplists:get_value(<<"language">>, Props, <<"javascript">>),
ShowSrc = get_nested_json_value({Props}, [<<"shows">>, ShowName]),
- Doc = couch_httpd_db:couch_doc_open(Db, DocId, [], [], false),
+ Doc = try couch_httpd_db:couch_doc_open(Db, DocId, [], []) of
+ FoundDoc -> FoundDoc
+ catch
+ _ -> nil
+ end,
send_doc_show_response(Lang, ShowSrc, DocId, Doc, Req, Db);
handle_doc_show_req(#httpd{