mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
61e441be41
commit
aad96d6b09
@ -209,9 +209,10 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
|
||||
ApiFunction::Ptr afunc = ApiFunction::GetByName(method);
|
||||
|
||||
if (!afunc)
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Function '" + method + "' does not exist."));
|
||||
|
||||
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
|
||||
Log(LogWarning, "JsonRpcConnection")
|
||||
<< "Call to non-existent function '" << method << "' from endpoint '" << m_Identity << "'.";
|
||||
else
|
||||
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
|
||||
} catch (const std::exception& ex) {
|
||||
/* TODO: Add a user readable error message for the remote caller */
|
||||
String diagInfo = DiagnosticInformation(ex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user