mozilla / ActiveData

Provide high speed filtering and aggregation over data
Mozilla Public License 2.0
31 stars 20 forks source link

Better post-parser hints #162

Open klahnakoski opened 5 years ago

klahnakoski commented 5 years ago

The query interpreter happily throws an error when it can not work with the query handed to it. This make for some ugly errors:

Call to ActiveData failed
    File ESQueryRunner.js, line 33, in ActiveDataQuery
    File thread.js, line 247, in Thread_prototype_resume
    File thread.js, line 226, in retval
    File Rest.js, line 46, in Rest.send/ajaxParam.error
    File Rest.js, line 100, in Rest.send/request.onreadystatechange
caused by Error while calling /query
caused by Bad response (400)
caused by programmer error expr = [object Object] 

Make some tests for common mistakes, and have the interpreter return better errors.

klahnakoski commented 5 years ago

The last one is easy, but the first two can be legit, so need more context.