summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-10-26 19:50:04 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-10-26 19:50:04 +0000
commit371db8eefbb1d71ae7495e0ea588016378834ec2 (patch)
tree1f2e3b8203cf13cbffc7f548216a2bf9c45d61d0
parent53026f5b398791546af8cf347af9adf70c1fa23c (diff)
asking for a missing rev with ?rev or ?open_revs was a 500 response
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@829919 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_httpd_db.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 32fc1b11..bd83cd87 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -684,7 +684,8 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
Json = ?JSON_ENCODE({[{ok, JsonDoc}]}),
send_chunk(Resp, AccSeparator ++ Json);
{{not_found, missing}, RevId} ->
- Json = ?JSON_ENCODE({[{"missing", RevId}]}),
+ RevStr = couch_doc:rev_to_str(RevId),
+ Json = ?JSON_ENCODE({[{"missing", RevStr}]}),
send_chunk(Resp, AccSeparator ++ Json)
end,
"," % AccSeparator now has a comma
@@ -846,6 +847,8 @@ couch_doc_open(Db, DocId, Rev, Options) ->
case couch_db:open_doc_revs(Db, DocId, [Rev], Options) of
{ok, [{ok, Doc}]} ->
Doc;
+ {ok, [{{not_found, missing}, Rev}]} ->
+ throw(not_found);
{ok, [Else]} ->
throw(Else)
end