]> granicus.if.org Git - icinga2/commitdiff
Cluster: Don't try to sync objects from broken _api package
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 26 Apr 2019 12:43:38 +0000 (14:43 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 26 Apr 2019 12:43:38 +0000 (14:43 +0200)
lib/remote/apilistener-configsync.cpp

index e06d1d88775b70b40154754b2ae88734043f072e..6b4bec1386c1352ccbdc00ebf122c28410d1d2fc 100644 (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)