Skip to content
Snippets Groups Projects
Commit f72ac523 authored by Jens Georg's avatar Jens Georg
Browse files

Add exception printout for missing ConfigReader

This is to support when running under Boost::Test which will swallow the
message otherwise and print the confusing ~AppBase() message of not
being properly shut down
parent a9914546
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,13 @@ namespace ChimeraTK {
instance = dynamic_cast<ConfigReader*>(mod);
}
if(nConfigReaders != 1) {
throw ChimeraTK::logic_error("ApplicationModule::appConfig() called but " + std::to_string(nConfigReaders) +
" instances of ChimeraTK::ConfigReader have been found.");
std::string message = "ApplicationModule::appConfig() called but " + std::to_string(nConfigReaders) +
" instances of ChimeraTK::ConfigReader have been found.";
// Printing the message as well; there is a situation when running under Boost::Test where this
// is caught by Boost and causes a weird destructor message from AppBase.cc instead with no means of
// finding out the actual error
std::cerr << message << std::endl;
throw ChimeraTK::logic_error(message);
}
return *instance;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment