couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [38/50] couch commit: updated refs/heads/2971-count-distinct to ee32cd5
Date Wed, 01 Mar 2017 16:39:25 GMT
Don't crash on unexpected validation's error type

Validation function can throw JSON with error
type different than forbidden or unauthorized.

This patch makes couch return unknown_error
instead of crashing query server.

COUCHDB-3286


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

Branch: refs/heads/2971-count-distinct
Commit: 6412412ce76e42adb7b1f899f7eebc704b8d6416
Parents: 604edd1
Author: Eric Avdey <eiri@eiri.ca>
Authored: Mon Jan 30 15:27:59 2017 -0400
Committer: Eric Avdey <eiri@eiri.ca>
Committed: Mon Jan 30 15:27:59 2017 -0400

----------------------------------------------------------------------
 src/couch_query_servers.erl | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6412412c/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index ea7628e..92d9e24 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -289,6 +289,8 @@ validate_doc_update(DDoc, EditDoc, DiskDoc, Ctx, SecObj) ->
             throw({forbidden, Message});
         {[{<<"unauthorized">>, Message}]} ->
             throw({unauthorized, Message});
+        {[{_, Message}]} ->
+            throw({unknown_error, Message});
         Message when is_binary(Message) ->
             throw({unknown_error, Message})
     end.


Mime
View raw message