locks / ember-localstorage-adapter

Name says it all.
MIT License
466 stars 156 forks source link

Resolve no results instead of rejecting the promise #185

Closed oscarni closed 7 years ago

oscarni commented 8 years ago

When using Sentry this localstorage adapter reports an error every time a query result is empty. How about resolving no results instead of rejecting the promise?

In my usecase an empty response is desired if the query in question returns an empty result, it's not an error.

Here is the rejection: https://github.com/locks/ember-localstorage-adapter/blob/master/addon/adapters/ls-adapter.js#L115

How about resolving it like it's done here: https://github.com/locks/ember-localstorage-adapter/blob/master/addon/adapters/ls-adapter.js#L90

oscarni commented 8 years ago

My referenced PR updates this. Please consider it :)

eccegordo commented 7 years ago

Yeah this is kind of unexpected behavior. If you don't want to resolve results then perhaps consider updating the read me with example code on how to handle the rejected promise.

Newbies might be tripped up by this. 😄