From 39676602971f4834eda462d8336f387c470548bb Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 27 Jan 2021 18:02:01 +0000 Subject: [PATCH] Improved handling of exceptions and logging --- WSJTXLogging.cpp | 7 +------ main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/WSJTXLogging.cpp b/WSJTXLogging.cpp index e0ba871bd..d18d938ae 100644 --- a/WSJTXLogging.cpp +++ b/WSJTXLogging.cpp @@ -57,7 +57,7 @@ namespace void operator () (std::logic_error const& e) const { std::cout << "std::logic_error: " << e.what () << std::endl; - //throw; + throw; } }; @@ -103,11 +103,6 @@ namespace << boost::log::add_value ("Function", function) << context.category << ": " << msg.toStdWString (); } - if (QtFatalMsg == type) - { - // bail out - throw std::runtime_error {"Fatal Qt Error"}; - } } } diff --git a/main.cpp b/main.cpp index c6dd0ccbf..85e5cc95f 100644 --- a/main.cpp +++ b/main.cpp @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) auto const env = QProcessEnvironment::systemEnvironment (); - QApplication a(argc, argv); + ExceptionCatchingApplication a(argc, argv); try { // LOG_INfO ("+++++++++++++++++++++++++++ Resources ++++++++++++++++++++++++++++"); @@ -397,7 +397,7 @@ int main(int argc, char *argv[]) a.translate ("main", "Unable to create shared memory segment")); throw std::runtime_error {"Shared memory error"}; } - LOG_INFO ("shmem size:" << mem_jt9.size ()); + LOG_INFO ("shmem size: " << mem_jt9.size ()); } else {