Permalink
Browse files

fix HTTP MR error reporting (cherry pick PR #639)

These case clauses haven't matched since the 1.3 release, if my
testing is correct. This patch reinstates use of
riak_kv_mapred_json:jsonify_pipe_error to send useful JSON to
an HTTP client.

This is a cherry-pick of commit 41890a9
from pull request #639.
  • Loading branch information...
1 parent 4c93b62 commit 01190f23099bf7febbb69d74f6b4922a91d045e3 Bryan Fink committed Aug 19, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/riak_kv_wm_mapred.erl
View
@@ -208,9 +208,10 @@ pipe_mapred_nonchunked(RD, State, Mrc) ->
{error, timeout} ->
riak_kv_mrc_pipe:destroy_sink(Mrc),
{{halt, 500}, send_error({error, timeout}, RD), State};
- {error, {_From, {Error, _Input}}} ->
+ {error, {From, Info}} ->
riak_kv_mrc_pipe:destroy_sink(Mrc),
- {{halt, 500}, send_error({error, Error}, RD), State}
+ Json = riak_kv_mapred_json:jsonify_pipe_error(From, Info),
+ {{halt, 500}, send_error({error, Json}, RD), State}
end.
pipe_mapred_chunked(RD, State, Mrc) ->
@@ -265,9 +266,10 @@ pipe_stream_mapred_results(RD,
%% detroyed the pipe
riak_kv_mrc_pipe:cleanup_sink(Mrc),
{format_error(Error), done};
- {error, {_From, {Error, _Input}}, _} ->
+ {error, {From, Info}, _} ->
riak_kv_mrc_pipe:destroy_sink(Mrc),
- {format_error({error, Error}), done}
+ Json = riak_kv_mapred_json:jsonify_pipe_error(From, Info),
+ {format_error({error, Json}), done}
end.
result_part({PhaseId, Results}, HasMRQuery, Boundary) ->

0 comments on commit 01190f2

Please sign in to comment.