Main: output exception stream directly to stdout

printf is used to output formated stringstream. Not only introductory
information is somewhat repeated, but text can be sent directly to
standard output.
This commit is contained in:
Ladislav Michl
2025-04-18 19:11:17 +02:00
parent 181fb46ad6
commit e4e99aa789
2 changed files with 18 additions and 24 deletions

View File

@@ -45,7 +45,6 @@
#endif // HAVE_CONFIG_H
#include <cstdio>
#include <sstream>
#include <iostream>
#include <QByteArray>
@@ -176,11 +175,10 @@ PyMOD_INIT_FUNC(FreeCAD)
}
catch (const Base::Exception& e) {
std::string appName = App::Application::Config()["ExeName"];
std::stringstream msg;
msg << "While initializing " << appName << " the following exception occurred: '"
<< e.what() << "'\n\n";
msg << "\nPlease contact the application's support team for more information.\n\n";
printf("Initialization of %s failed:\n%s", appName.c_str(), msg.str().c_str());
std::cout << "While initializing " << appName << " the following exception occurred: '"
<< e.what() << "'\n\n";
std::cout << "Please contact the application's support team for more information."
<< std::endl;
}
Base::EmptySequencer* seq = new Base::EmptySequencer();