mirror of https://github.com/Icinga/icinga2.git
parent
a8cc0a601b
commit
440f848c7c
|
@ -202,7 +202,12 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
|
||||||
ApiCallbackInfo aci = it->second;
|
ApiCallbackInfo aci = it->second;
|
||||||
m_ApiCallbacks.erase(it);
|
m_ApiCallbacks.erase(it);
|
||||||
|
|
||||||
aci.Callback(message);
|
try {
|
||||||
|
aci.Callback(message);
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
Log(LogWarning, "JsonRpcConnection")
|
||||||
|
<< "Error while processing message for identity '" << m_Identity << "'\n" << DiagnosticInformation(ex);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -223,11 +228,10 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
|
||||||
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
|
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
/* TODO: Add a user readable error message for the remote caller */
|
/* TODO: Add a user readable error message for the remote caller */
|
||||||
resultMessage->Set("error", DiagnosticInformation(ex));
|
String diagInfo = DiagnosticInformation(ex);
|
||||||
std::ostringstream info;
|
resultMessage->Set("error", diagInfo);
|
||||||
info << "Error while processing message for identity '" << m_Identity << "'";
|
|
||||||
Log(LogWarning, "JsonRpcConnection")
|
Log(LogWarning, "JsonRpcConnection")
|
||||||
<< info.str() << "\n" << DiagnosticInformation(ex);
|
<< "Error while processing message for identity '" << m_Identity << "'\n" << diagInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message->Contains("id")) {
|
if (message->Contains("id")) {
|
||||||
|
|
Loading…
Reference in New Issue