Catch exceptions in FreeCADCmd like FreeCAD

This commit is contained in:
Ian Rees 2016-03-26 20:49:47 +13:00
parent 287f3d94ca
commit 3cd752417b

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");