couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r755023 - in /couchdb/trunk: etc/couchdb/local_dev.ini src/couchdb/couch_doc.erl
Date Mon, 16 Mar 2009 22:13:19 GMT
Author: jchris
Date: Mon Mar 16 22:13:19 2009
New Revision: 755023

URL: http://svn.apache.org/viewvc?rev=755023&view=rev
Log:
sensible error message if doc._rev is null or a number

Modified:
    couchdb/trunk/etc/couchdb/local_dev.ini
    couchdb/trunk/src/couchdb/couch_doc.erl

Modified: couchdb/trunk/etc/couchdb/local_dev.ini
URL: http://svn.apache.org/viewvc/couchdb/trunk/etc/couchdb/local_dev.ini?rev=755023&r1=755022&r2=755023&view=diff
==============================================================================
--- couchdb/trunk/etc/couchdb/local_dev.ini (original)
+++ couchdb/trunk/etc/couchdb/local_dev.ini Mon Mar 16 22:13:19 2009
@@ -8,7 +8,7 @@
 ;max_document_size = 4294967296 ; bytes
 
 [httpd]
-;port = 5984
+; port = 5985
 ;bind_address = 127.0.0.1
 
 [log]
@@ -16,3 +16,6 @@
 
 [update_notification]
 ;unique notifier name=/full/path/to/exe -with "cmd line arg"
+
+; [admins]
+; jchris = -hashed-2431cc2e25f79c94e260383875a0efb615f4a7a6,15dc1c40afed7b0c9b23a06b76e17a08
\ No newline at end of file

Modified: couchdb/trunk/src/couchdb/couch_doc.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_doc.erl?rev=755023&r1=755022&r2=755023&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_doc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_doc.erl Mon Mar 16 22:13:19 2009
@@ -128,12 +128,14 @@
 
 parse_rev(Rev) when is_binary(Rev) ->
     parse_rev(?b2l(Rev));
-parse_rev(Rev) ->
+parse_rev(Rev) when is_list(Rev) ->
     SplitRev = lists:splitwith(fun($-) -> false; (_) -> true end, Rev),
     case SplitRev of 
         {Pos, [$- | RevId]} -> {list_to_integer(Pos), ?l2b(RevId)};
         _Else -> throw({bad_request, <<"Invalid rev format">>})
-    end.
+    end;
+parse_rev(_BadRev) ->
+    throw({bad_request, <<"Invalid rev format">>}).
     
 parse_revs([]) ->
     [];



Mime
View raw message