winterhazel commented on code in PR #11443:
URL: https://github.com/apache/cloudstack/pull/11443#discussion_r3170249886
##########
api/src/main/java/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java:
##########
@@ -97,17 +112,12 @@ public long getEntityOwnerId() {
@Override
public void execute() {
- if (ids == null && type == null && endDate == null) {
- throw new InvalidParameterValueException("either ids, type or
enddate must be specified");
- } else if (startDate != null && endDate == null) {
- throw new InvalidParameterValueException("enddate must be
specified with startdate parameter");
- }
boolean result = _mgr.archiveEvents(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
- } else {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Unable
to archive Events, one or more parameters has invalid values");
+ return;
}
+ throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Unable to
archive Events. One or more parameters have invalid values.");
}
Review Comment:
This was the previous behavior. I do not want to change the response of the
API in this patch, just optimize its operations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]