pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21k stars 1.02k forks source link

Better error messages on invalid index #146

Closed natew closed 7 years ago

natew commented 7 years ago

When you attempt to query using an index that doesn't exist you get an error like this:

Cannot read property 'type' of undefined

Because I'm using RxDB + Mobx it's doubly confusing as mobx catches it and displays:

image

Which is really hard to parse. Any chance we could make the errors here a bit nicer, including some information on the query and whats wrong with it? Ideally:

Could not compile query $('users').find().sort({ created: 'desc' }):
   The sort field "created" is not a field in the schema!
pubkey commented 7 years ago

@natew Can you paste some code to easy reproduce the error? I not quite sure if I understood where the error-message can be improved.