From: Michael Friedrich Date: Fri, 26 Apr 2019 12:43:38 +0000 (+0200) Subject: Cluster: Don't try to sync objects from broken _api package X-Git-Tag: v2.11.0-rc1~119^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f92c134b0a00f316722fb031a1ded362e7829f57;p=icinga2 Cluster: Don't try to sync objects from broken _api package --- diff --git a/lib/remote/apilistener-configsync.cpp b/lib/remote/apilistener-configsync.cpp index e06d1d887..6b4bec138 100644 --- a/lib/remote/apilistener-configsync.cpp +++ b/lib/remote/apilistener-configsync.cpp @@ -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)