From ea0721138a4cf9fa51a714818dc3e23dc3633342 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Wed, 20 Sep 2023 15:57:06 +0100 Subject: [PATCH] Reduce preprocessor coverage to avoid masking source dependencies. --- nano/lib/thread_runner.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nano/lib/thread_runner.cpp b/nano/lib/thread_runner.cpp index 9826ee5e..8e2c3087 100644 --- a/nano/lib/thread_runner.cpp +++ b/nano/lib/thread_runner.cpp @@ -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 + } }); } }