mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
ApiListener: Catch & supress clients runtime errors
This commit is contained in:
parent
932a53449d
commit
e062ceb901
@ -1023,7 +1023,12 @@ void ApiListener::ApiTimerHandler()
|
|||||||
|
|
||||||
for (const JsonRpcConnection::Ptr& client : endpoint->GetClients()) {
|
for (const JsonRpcConnection::Ptr& client : endpoint->GetClients()) {
|
||||||
if (client->GetTimestamp() == maxTs) {
|
if (client->GetTimestamp() == maxTs) {
|
||||||
client->SendMessage(lmessage);
|
try {
|
||||||
|
client->SendMessage(lmessage);
|
||||||
|
} catch (const std::runtime_error& ex) {
|
||||||
|
Log(LogNotice, "ApiListener")
|
||||||
|
<< "Error while setting log position for identity '" << endpoint->GetName() << "': " << DiagnosticInformation(ex, false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
client->Disconnect();
|
client->Disconnect();
|
||||||
}
|
}
|
||||||
@ -1195,7 +1200,12 @@ void ApiListener::SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionar
|
|||||||
if (client->GetTimestamp() != maxTs)
|
if (client->GetTimestamp() != maxTs)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
client->SendMessage(message);
|
try {
|
||||||
|
client->SendMessage(message);
|
||||||
|
} catch (const std::runtime_error& ex) {
|
||||||
|
Log(LogNotice, "ApiListener")
|
||||||
|
<< "Error while sending message to endpoint '" << endpoint->GetName() << "': " << DiagnosticInformation(ex, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user