Permalink
Browse files

MB-6895 Deal with new mapreduce API

When a map call succeeds, the returned value is no longer
only a list of lists of KVs. An outter list element can
also be an error tuple now, which tells us there was an
error for a specific map function of a view.

Change-Id: If4a19c0d21e21756f749747841c07ec00b798d85
Reviewed-on: http://review.couchbase.org/24206
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
  • Loading branch information...
1 parent 8997159 commit 5f5706d8a0db214aaa942ca496661938eaf2385e @fdmanana fdmanana committed Jan 25, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/geocouch/couch_spatial_updater.erl
@@ -163,9 +163,15 @@ spatial_docs(MapCtx, [Doc | RestDocs], EmptyResults, Acc) ->
SpatialResults = lists:map(
fun(FunRs) ->
case FunRs of
- [] -> [];
- % do some post-processing of the result documents
- FunRs -> process_results(FunRs)
+ {error, Reason} ->
+ ?LOG_ERROR("Error computing spatial result for document `~s`: ~p",
+ [Doc#doc.id, Reason]),
+ [];
+ [] ->
+ [];
+ FunRs ->
+ % do some post-processing of the result documents
+ process_results(FunRs)
end
end,
FunsResults),

0 comments on commit 5f5706d

Please sign in to comment.