aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-20 21:31:25 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-20 21:31:25 +0200
commit4e03ae2fef20449de094baf52c5a8acf27a77adb (patch)
treed36c2bd12658eda6fbd724e6f9234914504e9c57 /c
parent561ee240477e348efcd3670a5481ccb538d6724b (diff)
downloadEpisodeBrowser-4e03ae2fef20449de094baf52c5a8acf27a77adb.tar.gz
Improve fatal error messages.
As the message box has no owner (because the main window may not be initialized yet), it may be unclear which application is being terminated.
Diffstat (limited to 'c')
-rw-r--r--c/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 3746bb6..c426c65 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -51,24 +51,24 @@ void OnTerminate() noexcept
try {
std::rethrow_exception(std::current_exception());
} catch (const term_t& t) {
- std::basic_string<TCHAR> tstr = TEXT("The program was terminated due to a Prolog exception: ");
+ std::basic_string<TCHAR> tstr = TEXT("Episode Browser was terminated due to a Prolog exception: ");
TCHAR* tsz;
if (PL_get_tchars(t, &tsz, CVT_WRITE)) {
tstr += tsz;
MessageBox(NULL, tstr.c_str(), TEXT("Fatal Error"), MB_ICONERROR);
} else
- MessageBoxA(NULL, "The program was terminated due to a Prolog exception.",
+ MessageBoxA(NULL, "Episode Browser was terminated due to a Prolog exception.",
"Fatal Error", MB_ICONERROR);
} catch (Win32Error& e) {
- std::basic_string<TCHAR> tstr = TEXT("The program was terminated due to a Windows error: ");
+ std::basic_string<TCHAR> tstr = TEXT("Episode Browser was terminated due to a Windows error: ");
tstr += e.what<TCHAR>();
MessageBox(NULL, tstr.c_str(), TEXT("Fatal Error"), MB_ICONERROR);
} catch (std::exception& e) {
- std::string str = "The program was terminated due to an exception: ";
+ std::string str = "Episode Browser was terminated due to an exception: ";
str += e.what();
MessageBoxA(NULL, str.c_str(), "Fatal Error", MB_ICONERROR);
} catch (...) {
- MessageBoxA(NULL, "The program was terminated due to an exception.",
+ MessageBoxA(NULL, "Episode Browser was terminated due to an exception.",
"Fatal Error", MB_ICONERROR);
}
_Exit(1);