diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp index a2674dcb08d101b73a4835dde91d31b97f6865e8..45b40da01e6d2fd6d720ca1f19fea6ceda6ac564 100644 --- a/components/common/cpp/src/configuration.cpp +++ b/components/common/cpp/src/configuration.cpp @@ -115,10 +115,15 @@ static bool mergeConfig(const string &path) { ifstream i; i.open(path); if (i.is_open()) { - json t; - i >> t; - config.merge_patch(t); - return true; + try { + json t; + i >> t; + config.merge_patch(t); + return true; + } catch (json::parse_error& e) { + LOG(ERROR) << "Parse error in loading config: " << e.what(); + return false; + } } else { return false; }