Skip to content
Snippets Groups Projects
Commit dac4666c authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fixes #33 by try catch

parent 495c17af
No related branches found
No related tags found
No related merge requests found
Pipeline #10890 passed
...@@ -115,10 +115,15 @@ static bool mergeConfig(const string &path) { ...@@ -115,10 +115,15 @@ static bool mergeConfig(const string &path) {
ifstream i; ifstream i;
i.open(path); i.open(path);
if (i.is_open()) { if (i.is_open()) {
json t; try {
i >> t; json t;
config.merge_patch(t); i >> t;
return true; config.merge_patch(t);
return true;
} catch (json::parse_error& e) {
LOG(ERROR) << "Parse error in loading config: " << e.what();
return false;
}
} else { } else {
return false; return false;
} }
......
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