mirror of
https://github.com/Icinga/icinga2.git
synced 2026-06-11 01:30:22 -04:00
Merge 60326987ba into f63bbec4ab
This commit is contained in:
commit
1e9592059c
1 changed files with 9 additions and 4 deletions
|
|
@ -54,9 +54,14 @@ bool ActionsHandler::HandleRequest(
|
|||
|
||||
try {
|
||||
objs = FilterUtility::GetFilterTargets(qd, params, user);
|
||||
} catch (const std::exception& ex) {
|
||||
HttpUtility::SendJsonError(response, params, 404,
|
||||
"No objects found.",
|
||||
} catch (const std::invalid_argument& ex) {
|
||||
HttpUtility::SendJsonError(response, params, 400,
|
||||
"Invalid filter.",
|
||||
DiagnosticInformation(ex));
|
||||
return true;
|
||||
} catch (const ScriptError& ex) {
|
||||
HttpUtility::SendJsonError(response, params, 401,
|
||||
"Access denied for filter.",
|
||||
DiagnosticInformation(ex));
|
||||
return true;
|
||||
}
|
||||
|
|
@ -148,7 +153,7 @@ bool ActionsHandler::HandleRequest(
|
|||
statusCode = *okStatusCodes.begin();
|
||||
} else if (nonOkSize == 1u) {
|
||||
statusCode = *nonOkStatusCodes.begin();
|
||||
} else if (okSize >= 2u && nonOkSize == 0u) {
|
||||
} else if ((okSize == 0u || okSize >= 2u) && nonOkSize == 0u) {
|
||||
statusCode = 200;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue