Page MenuHomePhabricator

D13525.id44706.diff
No OneTemporary

D13525.id44706.diff

diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -651,7 +651,7 @@
error = e.what();
}
- this->cryptoThread->scheduleTask([=]() {
+ taskType cryptoJob = [=]() {
std::string error;
this->contentCryptoModule.reset(new crypto::CryptoModule(
this->publicCryptoAccountID,
@@ -688,7 +688,13 @@
this->jsInvoker_->invokeAsync(
[=]() { promise->resolve(jsi::Value::undefined()); });
- });
+ };
+ try {
+ this->cryptoThread->scheduleTask(cryptoJob);
+ } catch (const std::exception &e) {
+ error = e.what();
+ this->jsInvoker_->invokeAsync([=]() { promise->reject(error); });
+ }
};
GlobalDBSingleton::instance.scheduleOrRunCancellable(
job, promise, this->jsInvoker_);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 6:26 AM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2513880
Default Alt Text
D13525.id44706.diff (1 KB)

Event Timeline