aboutsummaryrefslogtreecommitdiff
path: root/c/data.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-07 00:40:26 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-07 00:40:26 +0200
commit2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160 (patch)
treed016a9456621b91ca902f0c1caf48468e899a553 /c/data.cpp
parent5b1a07607ba593050e37598f731f833b6faabee4 (diff)
downloadEpisodeBrowser-2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160.tar.gz
Improve error handling.
Diffstat (limited to 'c/data.cpp')
-rw-r--r--c/data.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/data.cpp b/c/data.cpp
index a75111a..32e059f 100644
--- a/c/data.cpp
+++ b/c/data.cpp
@@ -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)