Cluster: Don't try to sync objects from broken _api package

This commit is contained in:
Michael Friedrich 2019-04-26 14:43:38 +02:00
parent 0d6d48fd59
commit f92c134b0a
1 changed files with 9 additions and 1 deletions

View File

@ -282,7 +282,15 @@ void ApiListener::UpdateConfigObject(const ConfigObject::Ptr& object, const Mess
params->Set("version", object->GetVersion());
if (object->GetPackage() == "_api") {
String file = ConfigObjectUtility::GetObjectConfigPath(object->GetReflectionType(), object->GetName());
String file;
try {
file = ConfigObjectUtility::GetObjectConfigPath(object->GetReflectionType(), object->GetName());
} catch (const std::exception& ex) {
Log(LogNotice, "ApiListener")
<< "Cannot sync object '" << object->GetName() << "': " << ex.what();
return;
}
std::ifstream fp(file.CStr(), std::ifstream::binary);
if (!fp)