#include "application.hpp"
#include "config.h"
-#include <iostream>
+#include <typeinfo>
+
+#include <QDebug>
+
+#ifdef ENABLE_STACKTRACE
+#include <boost/stacktrace.hpp>
+#endif
-using std::cerr;
-using std::endl;
using std::exception;
Application::Application(int &argc, char* argv[]) :
try {
return QApplication::notify(receiver, event);
} catch (exception& e) {
- cerr << "Caught exception: " << e.what() << endl;
+ qDebug().nospace() << "Caught exception of type " << \
+ typeid(e).name() << " (" << e.what() << ")";
+#ifdef ENABLE_STACKTRACE
+ throw e;
+#else
exit(1);
+#endif
return false;
}
}