Change in ovirt-engine[ovirt-engine-4.0]: core: show descriptive error on illegal max value

tnisan at redhat.com tnisan at redhat.com
Tue Jul 19 12:04:05 UTC 2016


Tal Nisan has submitted this change and it was merged.

Change subject: core: show descriptive error on illegal max value
......................................................................


core: show descriptive error on illegal max value

Show descriptive error on illegal max value in search engine.

This patch fixes an issue when illegal negative max value is passed
to the search engine.

The problem was that the default value for the max parameter was -1 which
was translated as "no max parameter given" so all records should be
retrieved.
Instead of that, the default value was changed to Integer.MAX_VALUE
In addition, in case of RuntimeException, the exception was swallowed by
SearchQuery::initQueryData method and therefor the error was not
returned to the API call.
I changed that such that a RuntimeException will be thrown again after
writing to the log.

Change-Id: I1821b4a8109da4c48c8d8d32c0c52dadd1603b78
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1352953
Signed-off-by: emesika <emesika at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/SearchParameters.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendCollectionResource.java
3 files changed, 8 insertions(+), 7 deletions(-)

Approvals:
  Martin Peřina: Looks good to me, approved
  Eli Mesika: Verified
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/61014
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1821b4a8109da4c48c8d8d32c0c52dadd1603b78
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.0
Gerrit-Owner: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list