From d9be5bf578248f292ccdf78c36ea082f3111bf5e Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 30 Mar 2018 18:38:58 +0200 Subject: [PATCH] handle exception when running unit tests in GUI mode --- src/Gui/MainWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 8f0c4207f8..baa4f3675c 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1032,7 +1032,12 @@ void MainWindow::delayedStartup() { // automatically run unit tests in Gui if (App::Application::Config()["RunMode"] == "Internal") { - Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADTest")); + try { + Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADTest")); + } + catch (const Base::Exception& e) { + e.ReportException(); + } return; }