10#include "../utility/utility.hpp"
11#include "../console/console.hpp"
12#include "../telemetry/telemetry.hpp"
13#include "../macros.hpp"
20hi_export_module(hikogui.crt.terminate);
22namespace hi {
inline namespace v1 {
37 using namespace std::literals;
41 auto title = std::string_view{};
42 auto message = std::string_view{};
50 title =
"Unhandled std::exception."sv;
54 title =
"Unhandled unknown exception."sv;
55 message =
"<no data>"sv;
58 std::cerr << std::format(
"{}\n{}\n", title, message);
61 title =
"Abnormal termination."sv;
62 message =
debug_message.exchange(
nullptr, std::memory_order::relaxed);
65 dialog_ok(title, message);
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
std::terminate_handler old_terminate_handler
The old terminate handler.
Definition terminate.hpp:28
std::atomic< char const * > debug_message
Message to show when the application is terminated because of a debug_abort.
Definition debugger_intf.hpp:20
void terminate_handler() noexcept
The HikoGUI terminate handler.
Definition terminate.hpp:36
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
hi_no_inline void flush() noexcept
Flush all messages from the log_queue directly from this thread.
Definition log.hpp:145
T current_exception(T... args)
T rethrow_exception(T... args)