From f7e00bcc8d55d38d37b9a79c9bc8f12142bcce36 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Fri, 3 Apr 2020 17:44:40 +0200 Subject: [PATCH] Store std::exception::what() automatically before calling TRAP on unhandled exceptions * Makes it easier to inspect the message in debuggers --- include/continuable/detail/core/base.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/continuable/detail/core/base.hpp b/include/continuable/detail/core/base.hpp index 32b8c5d..d19729d 100644 --- a/include/continuable/detail/core/base.hpp +++ b/include/continuable/detail/core/base.hpp @@ -746,7 +746,8 @@ struct final_callback : util::non_copyable { try { std::rethrow_exception(exception); } catch (std::exception const& unhandled) { - (void)unhandled; + char const* const what = unhandled.what(); + (void)what; CTI_DETAIL_TRAP(); } catch (...) { CTI_DETAIL_TRAP();