From 87bca164f84edc37b549f86df3ce2cf14e2370bf Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 12 Jun 2021 02:08:51 +0100 Subject: [PATCH] Don't allow application to continue after an uncaught exception Qt does not allow exceptions to pass through the event loop so we must abort. --- ExceptionCatchingApplication.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ExceptionCatchingApplication.hpp b/ExceptionCatchingApplication.hpp index 04c04d62e..cfebc96fd 100644 --- a/ExceptionCatchingApplication.hpp +++ b/ExceptionCatchingApplication.hpp @@ -31,11 +31,13 @@ public: } catch (std::exception const& e) { - LOG_FATAL (e.what ()); + LOG_FATAL ("Unexpected exception caught in event loop: " << e.what ()); + qFatal ("Aborting"); } catch (...) { - LOG_FATAL ("Unexpected fatal error"); + LOG_FATAL ("Unexpected unknown exception caught in event loop"); + qFatal ("Aborting"); } return false; }