[native] introduce error handling to cover cancelled database tasks
Summary:
context: ENG-2139
This code allows handling exceptions generated by canceling tasks (for now only when clearSensitiveData is called.
In the future maybe it will be cleaner and better to rely on the error code to avoid parsing the message but for now it's not possible, rejecting the promise allows passing only string link;
Test Plan:
- Build app for both iOS and Android
- Add changes with CommCoreModule methods which will simplify testing: D5582
- Run code with bot sync and async code when tasks are canceled, surround with try {} catch.. to detect if checkIfTaskWasCancelled works correctly for both.
- Check if previous integrations with the database work properly eg. by adding some drafts etc.
Reviewers: marcin, tomek, atul
Reviewed By: marcin, tomek
Subscribers: ashoat, tomek, atul, abosh
Differential Revision: https://phab.comm.dev/D5594