couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1042260 - /couchdb/trunk/src/couchdb/couch_native_process.erl
Date Sat, 04 Dec 2010 23:06:58 GMT
Author: jan
Date: Sat Dec  4 23:06:57 2010
New Revision: 1042260

URL: http://svn.apache.org/viewvc?rev=1042260&view=rev
Log:
show runtime errors in native list functions

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

Modified: couchdb/trunk/src/couchdb/couch_native_process.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_native_process.erl?rev=1042260&r1=1042259&r2=1042260&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_native_process.erl (original)
+++ couchdb/trunk/src/couchdb/couch_native_process.erl Sat Dec  4 23:06:57 2010
@@ -186,7 +186,14 @@ ddoc(State, {DDoc}, [FunPath, Args]) ->
 ddoc(State, {_, Fun}, [<<"validate_doc_update">>], Args) ->
     {State, (catch apply(Fun, Args))};
 ddoc(State, {_, Fun}, [<<"filters">>|_], [Docs, Req]) ->
-    Resp = lists:map(fun(Doc) -> (catch Fun(Doc, Req)) =:= true end, Docs),
+    FilterFunWrapper = fun(Doc) ->
+        case catch Fun(Doc, Req) of
+        true -> true;
+        false -> false;
+        {'EXIT', Error} -> ?LOG_ERROR("~p", [Error])
+        end
+    end,
+    Resp = lists:map(FilterFunWrapper, Docs),
     {State, [true, Resp]};
 ddoc(State, {_, Fun}, [<<"shows">>|_], Args) ->
     Resp = case (catch apply(Fun, Args)) of



Mime
View raw message