Github user kxepal commented on the issue:
https://github.com/apache/couchdb-couch/pull/229
It's still easy to confuse with the regular response because technically I
can produce the `{'error': ...}` value with a reduce function and that's
wouldn't be an error case.
I suggest to do the same as what we do for map functions errors: remove the
value key and add the error one at the same level instead. You'll have to crash
if error happened or you'll be forced to process the error field correctly.
So may be something like this?:
```
{
"rows": [
{
"key": null,
"error": "builtin_reduce_error",
"reason": "The _sum function requires that map values be
numbers, arrays of numbers, or objects, not '[{[{<<\"b\">>,\n"
},
]
}
```
I used the `error-reason` is a common pair of keys we throw in case of
errors, so it's well known pattern to handle. The errors dict is a something
new, but it could work as well if we can accumulate all the errors and fail
fast.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---