mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:10: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
|
|
@ -237,10 +237,19 @@ void OverlayProductView::Impl::LoadProduct(
|
|||
}
|
||||
|
||||
// Load file
|
||||
boost::asio::post(
|
||||
threadPool_,
|
||||
[=, this]()
|
||||
{ radarProductManager_->LoadLevel3Data(product, time, request); });
|
||||
boost::asio::post(threadPool_,
|
||||
[=, this]()
|
||||
{
|
||||
try
|
||||
{
|
||||
radarProductManager_->LoadLevel3Data(
|
||||
product, time, request);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
logger_->error(ex.what());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void OverlayProductView::Impl::ResetProducts()
|
||||
|
|
|
|||
|
|
@ -121,7 +121,18 @@ void RadarProductView::SelectTime(std::chrono::system_clock::time_point time)
|
|||
|
||||
void RadarProductView::Update()
|
||||
{
|
||||
boost::asio::post(thread_pool(), [this]() { ComputeSweep(); });
|
||||
boost::asio::post(thread_pool(),
|
||||
[this]()
|
||||
{
|
||||
try
|
||||
{
|
||||
ComputeSweep();
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
logger_->error(ex.what());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool RadarProductView::IsInitialized() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue