From f07b7d17cdb1e07d907fe1518bd7249b695e64f3 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 4 Dec 2012 20:43:47 +0100 Subject: [PATCH] improved exception handling --- apps/opencs/main.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index 15772eba0e..4b1a688c26 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -1,11 +1,37 @@ #include "editor.hpp" +#include +#include + #include +class Application : public QApplication +{ + private: + + bool notify (QObject *receiver, QEvent *event) + { + try + { + return QApplication::notify (receiver, event); + } + catch (const std::exception& exception) + { + std::cerr << "An exception has been caught: " << exception.what() << std::endl; + } + + return false; + } + + public: + + Application (int& argc, char *argv[]) : QApplication (argc, argv) {} +}; + int main(int argc, char *argv[]) { - QApplication mApplication (argc, argv); + Application mApplication (argc, argv); CS::Editor editor;