[native] Throw JSError in sync functions
Summary:
ENG-1471, code is based on this diff
Changes processMessageStoreOperationsSync and processThreadStoreOperationsSync to throw JSErrors instead of returning a boolean. Corresponding javascript code was changed from checking return value to a try/catch.
Test Plan:
Test on both Android and iOS.
- Place temporary throw std::system_error(ECANCELED, std::generic_category(), "error"); outside the for loop in processMessageStoreOperationsSync and build the app.
- Try and call the method with an empty array somewhere from javascript.
- The app shouldn't crash and should display that there was a JSError.
Reviewers: atul, marcin, jon, tomek
Reviewed By: marcin, tomek
Subscribers: marcin, ashoat, abosh
Differential Revision: https://phab.comm.dev/D5201