X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fapplication.cpp;h=c16c9c4b7c757e3a4312316bb69edb668ef2615e;hb=521bac13ae900d74005e5d76e2c88f586ec7367a;hp=66991dd985b3b5cd3d0765926784e5ec7e34847f;hpb=39eb0d45ab6c2910f08a1ad79ac60d188fa9f6ae;p=pulseview.git
diff --git a/pv/application.cpp b/pv/application.cpp
index 66991dd..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.h"
+#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;
}
}