This commit is contained in:
Tobias Deiminger 2026-05-23 14:09:50 +08:00 committed by GitHub
commit 1e9592059c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}