From d24ef6058f2d60100be44507d46014ef30010493 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 15 Oct 2020 03:29:20 +0300 Subject: WIP: add simple Process class --- include/winapi/error.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/winapi/error.hpp') diff --git a/include/winapi/error.hpp b/include/winapi/error.hpp index 4b3f1e0..89bcfed 100644 --- a/include/winapi/error.hpp +++ b/include/winapi/error.hpp @@ -9,6 +9,8 @@ #include +#include +#include #include #include @@ -31,5 +33,12 @@ inline const CategoryWindows& category_windows() { std::system_error windows(DWORD code, const char* function); +template +std::runtime_error custom(Ret ret, const char* function) { + std::ostringstream oss; + oss << "Function " << function << " failed with error code " << ret; + return std::runtime_error{oss.str()}; +} + } // namespace error } // namespace winapi -- cgit v1.2.3