summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_show.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_httpd_show.erl')
-rw-r--r--src/couchdb/couch_httpd_show.erl14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl
index 4ed11c2a..14b9b415 100644
--- a/src/couchdb/couch_httpd_show.erl
+++ b/src/couchdb/couch_httpd_show.erl
@@ -50,11 +50,10 @@ handle_doc_update_req(#httpd{
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, nil, []),
Lang = proplists:get_value(<<"language">>, Props, <<"javascript">>),
UpdateSrc = couch_util:get_nested_json_value({Props}, [<<"updates">>, UpdateName]),
- Doc = try couch_httpd_db:couch_doc_open(Db, DocId, nil, [conflicts]) of
- FoundDoc -> FoundDoc
- catch
- _ -> nil
- end,
+ Doc = try couch_httpd_db:couch_doc_open(Db, DocId, nil, [conflicts])
+ catch
+ _ -> nil
+ end,
send_doc_update_response(Lang, UpdateSrc, DocId, Doc, Req, Db);
handle_doc_update_req(#httpd{
@@ -66,13 +65,11 @@ handle_doc_update_req(#httpd{
UpdateSrc = couch_util:get_nested_json_value({Props}, [<<"updates">>, UpdateName]),
send_doc_update_response(Lang, UpdateSrc, nil, nil, Req, Db);
-
handle_doc_update_req(Req, _Db) ->
send_error(Req, 404, <<"update_error">>, <<"Invalid path.">>).
-
handle_doc_show(Req, DesignName, ShowName, DocId, Db) ->
DesignId = <<"_design/", DesignName/binary>>,
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, nil, []),
@@ -81,8 +78,7 @@ handle_doc_show(Req, DesignName, ShowName, DocId, Db) ->
Doc = case DocId of
nil -> nil;
_ ->
- try couch_httpd_db:couch_doc_open(Db, DocId, nil, [conflicts]) of
- FoundDoc -> FoundDoc
+ try couch_httpd_db:couch_doc_open(Db, DocId, nil, [conflicts])
catch
_ -> nil
end