]> granicus.if.org Git - icinga2/commitdiff
Improve error messages on Endpoint not belonging to a zone or multiple zones
authorMichael Friedrich <michael.friedrich@gmail.com>
Sat, 7 Feb 2015 19:07:34 +0000 (20:07 +0100)
committerMichael Friedrich <michael.friedrich@gmail.com>
Sat, 7 Feb 2015 19:07:34 +0000 (20:07 +0100)
fixes #8372

lib/remote/endpoint.cpp

index 8ba96a3f1a7f8eabf93be0695fe8c42cff76ebe4..85e3440303116e3ee8128f5c04096e8174fe0223 100644 (file)
@@ -46,14 +46,14 @@ void Endpoint::OnAllConfigLoaded(void)
 
                if (members.find(this) != members.end()) {
                        if (m_Zone)
-                               BOOST_THROW_EXCEPTION(std::runtime_error("Endpoint '" + GetName() + "' is in more than one zone."));
+                               BOOST_THROW_EXCEPTION(ScriptError("Endpoint '" + GetName() + "' is in more than one zone.", GetDebugInfo()));
 
                        m_Zone = zone;
                }
        }
 
        if (!m_Zone)
-               BOOST_THROW_EXCEPTION(std::runtime_error("Endpoint '" + GetName() + "' does not belong to a zone."));
+               BOOST_THROW_EXCEPTION(ScriptError("Endpoint '" + GetName() + "' does not belong to a zone.", GetDebugInfo()));
 }
 
 void Endpoint::AddClient(const ApiClient::Ptr& client)