diff options
| author | Stefan Boberg <[email protected]> | 2021-05-21 21:17:12 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-21 21:17:12 +0200 |
| commit | 9f62b35a7380db253cce3310fa5208b8c8e20ef5 (patch) | |
| tree | ea6bdb2a876649c2eb5e1142d9c1a2a2d1c96ca8 /zencore/thread.cpp | |
| parent | Renamed CasBlobFile -> BasicFile (diff) | |
| download | zen-9f62b35a7380db253cce3310fa5208b8c8e20ef5.tar.xz zen-9f62b35a7380db253cce3310fa5208b8c8e20ef5.zip | |
Cleaned up exception handling
We now use std::system_error where possible to report Win32 system errors. We still have WindowsException for general HRESULT based errors but we should phase it out where possible
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 80cf6f100..4451fd302 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -58,13 +58,15 @@ Event::Reset() bool Event::Wait(int TimeoutMs) { + using namespace std::literals; + const DWORD Timeout = (TimeoutMs < 0) ? INFINITE : TimeoutMs; DWORD Result = WaitForSingleObject(m_EventHandle, Timeout); if (Result == WAIT_FAILED) { - throw WindowsException("Event wait failed"); + zen::ThrowLastError("Event wait failed"sv); } return (Result == WAIT_OBJECT_0); |