From a6244f914633a4245fc71a987cb42fce0b7d8671 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 17 Sep 2021 23:07:45 +0200 Subject: Added ThrowSystemError() helper --- zencore/except.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zencore/except.cpp') diff --git a/zencore/except.cpp b/zencore/except.cpp index c06a26edd..44b8edffb 100644 --- a/zencore/except.cpp +++ b/zencore/except.cpp @@ -63,6 +63,12 @@ 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)); +} + std::string GetLastErrorAsString() { -- cgit v1.2.3