realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Throw exceptions on sync errors while opening if no sync.error callback is specified in config

Open kraenhansen opened this issue 8 years ago • 3 comments

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

kraenhansen avatar Nov 03 '17 13:11 kraenhansen

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?

kneth avatar Nov 06 '17 08:11 kneth

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.

blagoev avatar Nov 17 '17 13:11 blagoev

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.

kraenhansen avatar Mar 07 '18 21:03 kraenhansen