aboutsummaryrefslogtreecommitdiff
path: root/zencore/except.cpp
diff options
context:
space:
mode:
authorMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
committerMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
commit4a12683b27adb31bde9eb8f7df3b9e9cc8ec680a (patch)
treec8b2939d400dd4bccae73d2782b15c65d30db19d /zencore/except.cpp
parentAdd WaitForQuiescence RPC (diff)
parentTwo missing override keywords (diff)
downloadzen-wait_for_quiescence.tar.xz
zen-wait_for_quiescence.zip
Merge branch 'main' into wait_for_quiescencewait_for_quiescence
Diffstat (limited to 'zencore/except.cpp')
-rw-r--r--zencore/except.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/zencore/except.cpp b/zencore/except.cpp
index fae629286..2749d1984 100644
--- a/zencore/except.cpp
+++ b/zencore/except.cpp
@@ -58,12 +58,6 @@ ThrowSystemException([[maybe_unused]] HRESULT hRes, [[maybe_unused]] std::string
#endif // ZEN_PLATFORM_WINDOWS
void
-ThrowLastError(std::string_view Message)
-{
- throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()), std::string(Message));
-}
-
-void
ThrowSystemError(uint32_t ErrorCode, std::string_view Message)
{
throw std::system_error(std::error_code(ErrorCode, std::system_category()), std::string(Message));
@@ -83,11 +77,16 @@ GetSystemErrorAsString(uint32_t ErrorCode)
#if defined(__cpp_lib_source_location)
void
-ThrowLastError(std::string_view Message, const std::source_location& Location)
+ThrowLastErrorImpl(std::string_view Message, const std::source_location& Location)
{
- using namespace fmt::literals;
throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()),
- "{}({}): {}"_format(Location.file_name(), Location.line(), Message));
+ fmt::format("{}({}): {}", Location.file_name(), Location.line(), Message));
+}
+#else
+void
+ThrowLastError(std::string_view Message)
+{
+ throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()), std::string(Message));
}
#endif