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/episodelistview.cpp | |
parent | 5b1a07607ba593050e37598f731f833b6faabee4 (diff) | |
download | EpisodeBrowser-2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160.tar.gz |
Improve error handling.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index b683114..db67ca9 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -162,7 +162,8 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) const ElvDataA& e = parent.fvElv.At(nm->nmcd.lItemlParam-1); if (!e.bWatched) { extern HFONT g_hfBold; - Require(SelectObject(nm->nmcd.hdc, g_hfBold)); + if (!SelectObject(nm->nmcd.hdc, g_hfBold)) + throw Err(WINDOWS, L"Bold font could not be selected: %s"); return CDRF_NEWFONT; } break; @@ -183,8 +184,9 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) case NM_RCLICK: { const DWORD pos = GetMessagePos(); - Require(TrackPopupMenu(parent.hMenuPopup, TPM_RIGHTBUTTON, - LOWORD(pos), HIWORD(pos), 0, parent.hWnd, nullptr)); + if (!TrackPopupMenu(parent.hMenuPopup, TPM_RIGHTBUTTON, + LOWORD(pos), HIWORD(pos), 0, parent.hWnd, nullptr)) + throw Err(WINDOWS, L"Context menu could not be opened: %s"); return 0; } |