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/util.h | |
parent | 5b1a07607ba593050e37598f731f833b6faabee4 (diff) | |
download | EpisodeBrowser-2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160.tar.gz |
Improve error handling.
Diffstat (limited to 'c/util.h')
-rw-r--r-- | c/util.h | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -13,13 +13,6 @@ #define CONCAT(a, b) CONCAT_IMPL(a, b) #define _ CONCAT(unused_, __LINE__) -#define SET_TERMINATE \ - std::set_terminate([]() noexcept \ - { \ - EBMessageBox(What(), L"Fatal Error", MB_ICONERROR); \ - _Exit(1); \ - }) - /* Scope guard. */ template <typename F> struct Finally @@ -98,12 +91,12 @@ struct UniqueOk T v; UniqueOk(Unique<T, F>&& u) : v(std::move(u.v)) { - assert(u.ok, "UniqueOk may not be constructed from non-ok Unique"); + assert(u.ok); u.ok = false; } UniqueOk& operator =(Unique<T, F>&& u) { - assert(u.ok, "UniqueOk may not be constructed from non-ok Unique"); + assert(u.ok); F(v); v = std::move(u.v); u.ok = false; |