Catch exceptions in background threads

This commit is contained in:
Dan Paulat 2024-06-12 01:03:58 -05:00
parent 863cdd0384
commit e1d61fccfa
13 changed files with 866 additions and 665 deletions

View file

@ -42,7 +42,17 @@ public:
[this](const types::TextEventKey& key, size_t messageIndex)
{
boost::asio::post(threadPool_,
[=, this]() { HandleAlert(key, messageIndex); });
[=, this]()
{
try
{
HandleAlert(key, messageIndex);
}
catch (const std::exception& ex)
{
logger_->error(ex.what());
}
});
});
}