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 @@ -615,7 +615,6 @@ taskType job = [=]() { crypto::Persist contentPersist; crypto::Persist notifsPersist; - std::string error; try { std::optional contentAccountData = DatabaseManager::getQueryExecutor().getOlmPersistAccountData( @@ -647,8 +646,10 @@ notifsAccountData->begin(), notifsAccountData->end()); } - } catch (std::system_error &e) { - error = e.what(); + } catch (std::exception &e) { + std::string error = e.what(); + this->jsInvoker_->invokeAsync([=]() { promise->reject(error); }); + return; } taskType cryptoJob = [=]() { @@ -692,7 +693,7 @@ try { this->cryptoThread->scheduleTask(cryptoJob); } catch (const std::exception &e) { - error = e.what(); + std::string error = e.what(); this->jsInvoker_->invokeAsync([=]() { promise->reject(error); }); } };