summaryrefslogtreecommitdiff
path: root/ExceptionCatchingApplication.hpp
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
committerChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
commit0e579a45e2e5823f90e2632073749583cd15fa0d (patch)
tree5e709e13d41c8ea0da0968fb6c4566057b4b7909 /ExceptionCatchingApplication.hpp
parent28d1767618141cd6481de2e93e36e3dfa555d4b4 (diff)
parent2d1068e60bce7ae1fff11623454900e8cee956b1 (diff)
Update upstream source from tag 'upstream/2.6.0_rc3+repack'
Update to upstream version '2.6.0~rc3+repack' with Debian dir 9ee8bc3a4b60bb88f4d57c7d1f2d37dbc1632144
Diffstat (limited to 'ExceptionCatchingApplication.hpp')
-rwxr-xr-xExceptionCatchingApplication.hpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/ExceptionCatchingApplication.hpp b/ExceptionCatchingApplication.hpp
index b9a3f961..175edb8e 100755
--- a/ExceptionCatchingApplication.hpp
+++ b/ExceptionCatchingApplication.hpp
@@ -1,49 +1,49 @@
-#ifndef EXCEPTION_CATCHING_APPLICATION_HPP__
-#define EXCEPTION_CATCHING_APPLICATION_HPP__
-
-#include <QApplication>
-
-#include <boost/log/core.hpp>
-#include "Logger.hpp"
-
-class QObject;
-class QEvent;
-
-//
-// We can't use the GUI after QApplication::exit() is called so
-// uncaught exceptions can get lost on Windows systems where there is
-// no console terminal, so here we override QApplication::notify() and
-// wrap the base class call with a try block to catch and log any
-// uncaught exceptions.
-//
-class ExceptionCatchingApplication
- : public QApplication
-{
-public:
- explicit ExceptionCatchingApplication (int& argc, char * * argv)
- : QApplication {argc, argv}
- {
- }
- bool notify (QObject * receiver, QEvent * e) override
- {
- try
- {
- return QApplication::notify (receiver, e);
- }
- catch (std::exception const& e)
- {
- LOG_FATAL ("Unexpected exception caught in event loop: " << e.what ());
- }
- catch (...)
- {
- LOG_FATAL ("Unexpected unknown exception caught in event loop");
- }
- // There's nowhere to go from here as Qt will not pass exceptions
- // through the event loop, so we must abort.
- boost::log::core::get ()->flush ();
- qFatal ("Aborting");
- return false;
- }
-};
-
-#endif
+#ifndef EXCEPTION_CATCHING_APPLICATION_HPP__
+#define EXCEPTION_CATCHING_APPLICATION_HPP__
+
+#include <QApplication>
+
+#include <boost/log/core.hpp>
+#include "Logger.hpp"
+
+class QObject;
+class QEvent;
+
+//
+// We can't use the GUI after QApplication::exit() is called so
+// uncaught exceptions can get lost on Windows systems where there is
+// no console terminal, so here we override QApplication::notify() and
+// wrap the base class call with a try block to catch and log any
+// uncaught exceptions.
+//
+class ExceptionCatchingApplication
+ : public QApplication
+{
+public:
+ explicit ExceptionCatchingApplication (int& argc, char * * argv)
+ : QApplication {argc, argv}
+ {
+ }
+ bool notify (QObject * receiver, QEvent * e) override
+ {
+ try
+ {
+ return QApplication::notify (receiver, e);
+ }
+ catch (std::exception const& e)
+ {
+ LOG_FATAL ("Unexpected exception caught in event loop: " << e.what ());
+ }
+ catch (...)
+ {
+ LOG_FATAL ("Unexpected unknown exception caught in event loop");
+ }
+ // There's nowhere to go from here as Qt will not pass exceptions
+ // through the event loop, so we must abort.
+ boost::log::core::get ()->flush ();
+ qFatal ("Aborting");
+ return false;
+ }
+};
+
+#endif