Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a warning when parsing of the config file has failed #66

Merged
merged 2 commits into from Feb 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/SSEConfig.cpp
Expand Up @@ -70,7 +70,9 @@ bool SSEConfig::load(const char *file) {
// Read config file.
try {
boost::property_tree::read_json(file, pt);
} catch (...) {}
} catch (boost::property_tree::ptree_error& e) {
LOG(WARNING) << "Error during loading config file: " << e.what();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps log FATAL instead of WARNING? It shouldn't be able to start up at all without a proper config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing, this is absolutely a check we should have. I agree with @sgulseth regarding that it should be a FATAL and not a warning. Add in that and I will merge the PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've changed it to FATAL and now the app doesn't start when config is not parsed or not present. Thanks for your feedback.

}

// Populate ConfigMap.
BOOST_FOREACH(ConfigMap_t::value_type &element, ConfigMap) {
Expand Down