couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject [14/50] couch commit: updated refs/remotes/origin/import to 09c6556
Date Mon, 10 Feb 2014 20:05:14 GMT
Throw unknown_error for non standard errors

Right now unless you throw an error with the key forbidden or
unauthorized, we throw a stack trace back at you. This will at least let
you throw a string as an error message.

Whether or not we should return unknown_error: Message or throw an error
saying invalid error format in the validate_doc_update function is
debateable.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/af1f7e96
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/af1f7e96
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/af1f7e96

Branch: refs/remotes/origin/import
Commit: af1f7e965a47f6e0f436eef7d69f6c75dd2bab3d
Parents: 207708a
Author: Russell Branca <chewbranca@gmail.com>
Authored: Wed Jan 23 14:03:24 2013 -0800
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Tue Feb 4 17:03:24 2014 -0600

----------------------------------------------------------------------
 src/couch_query_servers.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/af1f7e96/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index 71dcae9..5864288 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -327,7 +327,9 @@ validate_doc_update(DDoc, EditDoc, DiskDoc, Ctx, SecObj) ->
         {[{<<"forbidden">>, Message}]} ->
             throw({forbidden, Message});
         {[{<<"unauthorized">>, Message}]} ->
-            throw({unauthorized, Message})
+            throw({unauthorized, Message});
+        <<Message/binary>> ->
+            throw({unknown_error, Message})
     end.
 
 json_doc(nil) -> null;


Mime
View raw message