ActiveData icon indicating copy to clipboard operation
ActiveData copied to clipboard

Better post-parser hints

Open klahnakoski opened this issue 5 years ago • 1 comments

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 avatar Aug 28 '19 20:08 klahnakoski

  • Passing objects to operators that expect arrays: {"or": {}}
  • more than one operator in an object: {"eq":{}, "missing":{}}
  • objects that have no known operator: {"test.name": blah"}

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

klahnakoski avatar Aug 28 '19 20:08 klahnakoski