[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-03-06 Thread iilyak
Github user iilyak commented on the issue: https://github.com/apache/couchdb-couch/pull/229 +1. All tests pass locally ``` Running test function(s): couch_query_servers:builtin_sum_rows_negative_test/0 couch_query_servers:sum_values_negative_test/0

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-03-06 Thread tonysun83
Github user tonysun83 commented on the issue: https://github.com/apache/couchdb-couch/pull/229 @iilyak : changed unused ref --- 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

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-03-01 Thread davisp
Github user davisp commented on the issue: https://github.com/apache/couchdb-couch/pull/229 Reduce functions are complicated so that makes sense. :D Unfortunately there's not a whole lot we can do without inventing a builtin-reduce specific error API/protocol which strikes me

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-24 Thread kxepal
Github user kxepal commented on the issue: https://github.com/apache/couchdb-couch/pull/229 @tonysun83 Good, thanks . I worried about to get there all the map data or some else large batch which could cause a troubles to receive, parse, load and process. Glad that this won't

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-24 Thread kxepal
Github user kxepal commented on the issue: https://github.com/apache/couchdb-couch/pull/229 @tonysun83 Nice work! One more little question: how much number of items will be in `caused_by` list? Everything what map function produced to reduce or just those ones which had caused

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-23 Thread davisp
Github user davisp commented on the issue: https://github.com/apache/couchdb-couch/pull/229 My bad, I missed the fact that we were talking about removing the top level value. I don't think we should do that in this case because of what I described earlier. These are just alternative

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-23 Thread davisp
Github user davisp commented on the issue: https://github.com/apache/couchdb-couch/pull/229 That was a really confusing description in hindsight... Consider it this way: what you're changing could easily be written as a custom reduce function in JavaScript. The only

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-22 Thread tonysun83
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}```.

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-22 Thread tonysun83
Github user tonysun83 commented on the issue: https://github.com/apache/couchdb-couch/pull/229 Ok, I think I figured it out. Just need to add a clause here with the return value from couch_query_servers:

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-21 Thread tonysun83
Github user tonysun83 commented on the issue: https://github.com/apache/couchdb-couch/pull/229 @iilyak : The only two error types I can think of are when the input value is invalid and also what @kxepal mentioned (the map function errors) which I forgot to take care of. In any case,

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-21 Thread kxepal
Github user kxepal commented on the issue: https://github.com/apache/couchdb-couch/pull/229 For map functions errors we return the response in the following format: ``` {"total_rows":14,"offset":0,"rows":[ {"key":1,"error":"not_found"} ]} ``` It's hard to

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-21 Thread kxepal
Github user kxepal commented on the issue: https://github.com/apache/couchdb-couch/pull/229 How the clients should handle such kind of response? It has the result data and it has some errons. Should the result be handled? Or an exception being throw? I think there should

[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-21 Thread iilyak
Github user iilyak commented on the issue: https://github.com/apache/couchdb-couch/pull/229 What about other kinds of errors? Should we consider returning errors as: ``` "value": { "key": [], "value": , "errors": {