Merge pull request #128 from ianrrees/20160326-catch-exceptions-FreeCADCmd

Catch exceptions in FreeCADCmd like FreeCAD
This commit is contained in:
wwmayer 2016-03-26 11:07:31 +01:00
commit 70eeb4b475

View File

@ -122,8 +122,18 @@ int main( int argc, char ** argv )
}
// Run phase ===========================================================
Application::runApplication();
try {
Application::runApplication();
}
catch (const Base::SystemExitException&) {
exit(0);
}
catch (const Base::Exception& e) {
e.ReportException();
}
catch (...) {
Console().Error("Application unexpectedly terminated\n");
}
// Destruction phase ===========================================================
Console().Log("FreeCAD terminating...\n");