diff options
author | John Ankarström <john@ankarstrom.se> | 2022-09-07 00:40:26 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-09-07 00:40:26 +0200 |
commit | 2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160 (patch) | |
tree | d016a9456621b91ca902f0c1caf48468e899a553 /c/data.cpp | |
parent | 5b1a07607ba593050e37598f731f833b6faabee4 (diff) | |
download | EpisodeBrowser-2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160.tar.gz |
Improve error handling.
Diffstat (limited to 'c/data.cpp')
-rw-r--r-- | c/data.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -118,7 +118,7 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) static auto procThread = [](void (*f)(unsigned char*)) noexcept -> void { - SET_TERMINATE; + std::set_terminate(OnTerminate); while (!(sig & READY)) Sleep(100); sig = 0; @@ -152,7 +152,8 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) s_window = &window; std::thread(procThread, f).detach(); s_window->Status(L".", 1); - Prefer(iTimer = SetTimer(nullptr, iTimer, 500, procTimer)); + if (!(iTimer = SetTimer(nullptr, iTimer, 500, procTimer))) + throw Err(WINDOWS, L"Timer could not be started: %s"); } void FetchData(unsigned char* sig) |