X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fapplication.cpp;h=c16c9c4b7c757e3a4312316bb69edb668ef2615e;hb=5cb28675542489f9c694b0002ec27694073e9687;hp=41f00f8cf1d918795701bb9b363b51096ed5aaeb;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329;p=pulseview.git
diff --git a/pv/application.cpp b/pv/application.cpp
index 41f00f8..c16c9c4 100644
--- a/pv/application.cpp
+++ b/pv/application.cpp
@@ -14,14 +14,21 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include "application.hpp"
#include "config.h"
-#include
+#include
+
+#include
+
+#ifdef ENABLE_STACKTRACE
+#include
+#endif
+
+using std::exception;
Application::Application(int &argc, char* argv[]) :
QApplication(argc, argv)
@@ -36,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;
}
}