From 2d9e445e1838d67ff642af06fb9417920e36ca7a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 20 Jan 2025 16:24:00 +0100 Subject: [PATCH] Require all exceptions to provide some text Otherwise what() returns nullptr and it makes catch handlers somewhat inconvenient if they need to test for this too. Signed-off-by: Simon Rozman --- include/WinStd/Common.h | 2 +- include/WinStd/Sec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index d5c28e4f..db493359 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -1350,7 +1350,7 @@ namespace winstd /// \param[in] num Numeric error code /// \param[in] msg Error message /// - num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : + num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg) : m_num(num), runtime_error(msg) {} diff --git a/include/WinStd/Sec.h b/include/WinStd/Sec.h index 90bb371c..8d3e5252 100644 --- a/include/WinStd/Sec.h +++ b/include/WinStd/Sec.h @@ -363,7 +363,7 @@ namespace winstd /// \param[in] num Security provider error code /// \param[in] msg Error message /// - sec_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) + sec_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg) : num_runtime_error(num, msg) {} ///