]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/app/application.cpp
More specific error message for "unknown" exceptions.
[toast/confclerk.git] / src / app / application.cpp
index baa86ef57d90581e2ca4a7fa8f2ef452bace720c..e8ad62bb44209875e5f78639c3b9ab67a252628c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2013 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2017 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
  * You should have received a copy of the GNU General Public License along with
  * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
  */
+#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
+#include <cxxabi.h>
+#endif
+#include <exception>
+
 #include "application.h"
 #include "errormessage.h"
 
@@ -32,8 +37,17 @@ bool Application::notify(QObject* receiver, QEvent* event)
     } catch (OrmException& e) {
         error_message("UNCAUGHT OrmException: " + e.text());
         return false;
+    } catch (std::exception& e) {
+        error_message("UNCAUGHT exception: " + QString(e.what()));
+        return false;
     } catch (...) {
-        error_message("UNCAUGHT EXCEPTION: unknown");
+        error_message("UNCAUGHT exception: " +
+#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
+                QString(__cxxabiv1::__cxa_current_exception_type()->name())
+#else
+                "unknown"
+#endif
+                );
         return false;
     }
 }