diff options
Diffstat (limited to 'src/error.hpp')
-rw-r--r-- | src/error.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/error.hpp b/src/error.hpp index 2ea7f85..ad43307 100644 --- a/src/error.hpp +++ b/src/error.hpp @@ -8,10 +8,15 @@ typedef std::system_error Error; namespace error { - inline void raise(const char* function_name) + Error make(const char* function_name) { const auto ec = GetLastError(); - throw std::system_error(ec, std::system_category(), function_name); + return {static_cast<int>(ec), std::system_category(), function_name}; + } + + inline void raise(const char* function_name) + { + throw make(function_name); } void report(const Error& e) |