Open miklschmidt opened 10 years ago
I support the issue, because .list(/) and .count() do fail! (see below for an example)
However, IMHO, a better solution would be just to use the same callback on line 711 of persistence.store.sql.js:
}, callback );
by the way, se same applies to .count() and again a simple fix is changing line 844 to
}, callback );
This is consistent with the general convention of persistence.js that callbacks should test their second argument; if it is not-null, it is a SQL error.
A simple index.html for testing:
All the sql stores has error callbacks in their executeSql methods, but the
list()
method in store.sql doesn't use them. So when a query fails, you'll never know.I ran into this issue while using the migration plugin, i accidentally created a table with the plural version of the entity's name, and didn't get any callbacks while using the
list()
function after doingEntity.all()
.I added support for error callbacks in
.list()
onDbQueryCollection
, to fix this issue.