Exception handling in intialization routine

Discussion of ideas for features and new projects based on POCO.
Posts: 4
Joined: 08 Jan 2012, 21:52

Exception handling in intialization routine

Postby Paranaix » 08 Jan 2012, 22:02

I found a little design flaw in the Poco::Util::Application class.

Code: Select all

int Application::run()
   int rc = EXIT_SOFTWARE;
      rc = main(_args);
   catch (Poco::Exception& exc)
   catch (std::exception& exc)
   catch (...)
      logger().fatal("system exception");
   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.

Posts: 1195
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Exception handling in intialization routine

Postby guenter » 10 Jan 2012, 14:46

I've fixed that in 1.4.3.

Return to “Wishlist”

Who is online

Users browsing this forum: No registered users and 2 guests