mesqueeb / vuex-easy-firestore

Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!
https://mesqueeb.github.io/vuex-easy-firestore
MIT License
234 stars 28 forks source link

fetchById throw error if document does not exists by given id #340

Open moreorover opened 4 years ago

moreorover commented 4 years ago

I had a quick look at the source, I think this should solve the issue, however, testing is required.

louisameline commented 4 years ago

I haven't tested, but from what I read, the function previously returned a string in case of error if logging is enabled, and now would throw an exception. Am I right? It's cleaner of course but this would be a breaking change for the people who leave logging enabled in production. Maybe you could change your PR to throw only if logging is disabled? I know it sounds stupid and returning strings is not the way to go, but the lib is going to be rewritten soon with proper error handling everywhere, so we might not want to break backward compatibility by trying to fix things now.