couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r829919 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl
Date Mon, 26 Oct 2009 19:50:05 GMT
Author: kocolosk
Date: Mon Oct 26 19:50:04 2009
New Revision: 829919

URL: http://svn.apache.org/viewvc?rev=829919&view=rev
Log:
asking for a missing rev with ?rev or ?open_revs was a 500 response

Modified:
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=829919&r1=829918&r2=829919&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Mon Oct 26 19:50:04 2009
@@ -684,7 +684,8 @@
                         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 @@
       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



Mime
View raw message