Github user tonysun83 commented on the issue: https://github.com/apache/couchdb-couch/pull/229 @kxepal : To get the format that we want above, I'm catching the throw from an invalid input, and then forcing couch_query_servers to return ```{builtin_reduce_error, Reason, Value}```. Then, I bubble up that return value and finally modify the message here: https://github.com/apache/couchdb-couch-mrview/blob/master/src/couch_mrview_http.erl#L431 with ``` row_to_json({builtin_reduce_error, Reason, Value}) -> Obj = {[{error, builtin_reduce_error}, {reason, Reason}, {caused_by, Value}]}, ?JSON_ENCODE(Obj); ``` However, maybe I'm not approaching this correctly since I am still confused with: "You'll have to crash if error happened or you'll be forced to process the error field correctly." Can you clarify a bit? Tomorrow, I'm going to test the scenario with a map function errors so I can better understand what's going on.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---