I found a little design flaw in the Poco::Util::Application class.
Poco::Util::Application::run():
- Code: Select all
int Application::run()
{
int rc = EXIT_SOFTWARE;
initialize(*this);
try
{
rc = main(_args);
}
catch (Poco::Exception& exc)
{
logger().log(exc);
}
catch (std::exception& exc)
{
logger().error(exc.what());
}
catch (...)
{
logger().fatal("system exception");
}
uninitialize();
return rc;
}
Although exceptions thrown in main() are logged, those in initialize() are not. This is important to me since i need to verify some configuration values which are required for the initialization.
Throwing a exception, if values are not correct, will cause termination of the programm but no logging.
Its easy to change that in the next version by putting initialize() in the try block.





