Reduce preprocessor coverage to avoid masking source dependencies.

This commit is contained in:
Colin LeMahieu 2023-09-20 15:57:06 +01:00
commit ea0721138a
No known key found for this signature in database
GPG key ID: 43708520C8DFB938

View file

@ -14,13 +14,6 @@ nano::thread_runner::thread_runner (boost::asio::io_context & io_ctx_a, unsigned
{
threads.emplace_back (nano::thread_attributes::get_default (), [this, &io_ctx_a] () {
nano::thread_role::set (role);
// In a release build, catch and swallow any exceptions,
// In debug mode let if fall through
#ifndef NDEBUG
run (io_ctx_a);
#else
try
{
run (io_ctx_a);
@ -28,11 +21,16 @@ nano::thread_runner::thread_runner (boost::asio::io_context & io_ctx_a, unsigned
catch (std::exception const & ex)
{
std::cerr << ex.what () << std::endl;
#ifndef NDEBUG
throw; // Re-throw to debugger in debug mode
#endif
}
catch (...)
{
}
#ifndef NDEBUG
throw; // Re-throw to debugger in debug mode
#endif
}
});
}
}