]> sigrok.org Git - pulseview.git/blobdiff - pv/application.cpp
Update property widgets before showing device config popup
[pulseview.git] / pv / application.cpp
index 80a22ab9ebb51faefc8124bc36b13df0c1e54ba7..c16c9c4b7c757e3a4312316bb69edb668ef2615e 100644 (file)
 #include "application.hpp"
 #include "config.h"
 
-#include <iostream>
+#include <typeinfo>
+
+#include <QDebug>
+
+#ifdef ENABLE_STACKTRACE
+#include <boost/stacktrace.hpp>
+#endif
+
+using std::exception;
 
 Application::Application(int &argc, char* argv[]) :
        QApplication(argc, argv)
@@ -35,9 +43,14 @@ bool Application::notify(QObject *receiver, QEvent *event)
 {
        try {
                return QApplication::notify(receiver, event);
-       } catch (std::exception& e) {
-               std::cerr << "Caught exception: " << e.what() << std::endl;
+       } catch (exception& e) {
+               qDebug().nospace() << "Caught exception of type " << \
+                       typeid(e).name() << " (" << e.what() << ")";
+#ifdef ENABLE_STACKTRACE
+               throw e;
+#else
                exit(1);
+#endif
                return false;
        }
 }