realm-js
realm-js copied to clipboard
Throw exceptions on sync errors while opening if no sync.error callback is specified in config
Goals
If I am not specifying an error callback on the sync configuration object - I never get sync errors.
Expected Results
I would expect these errors to be thrown, so I'll realize they are ocuring.
Actual Results
Sync errors are swallowed by Realm JS with the default configuration.
Steps to Reproduce
Do something that makes sync complain and see that nothing is thrown.
Code Sample
Realm.open({ sync: { /*... don't specify an error callback here */ } })
Version of Realm and Tooling
- Realm JS SDK Version: 2.0.2
I think it is up to the developer to choose not to do error handling. But we can write to the log to indicate the error situation. @kraenhansen would that be enough for you?
actually we might add an error handler for the user and throw an exception in there. Also I am starting to think we might need to add a new error handler even when user have specified an error handler themselves. This one is needed if we want to reject the Promise on sync errors.
I updated the title to reflect that this is specifically for errors happening while I am opening (and waiting for initial download of) the realm.