mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:20:06 +00:00
Catch exceptions in background threads
This commit is contained in:
parent
863cdd0384
commit
e1d61fccfa
13 changed files with 866 additions and 665 deletions
|
|
@ -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());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue