Idan Shaby has uploaded a new change for review. Change subject: core: Replaced returning null to throwing exception ......................................................................
core: Replaced returning null to throwing exception The getUserRequestForStorageDomainRepoFileList method used to return null when the storage domain was not valid. Now it throws a VdcBLLException with GetIsoListError type instead. There's no need to catch the exception in 'executeQueryCommand' in GetImagesListQueryBase or in GetImageByIdQuery because the one who calls them, QueriesCommandBase, does the job. Change-Id: I178783d1d57e8f8c68337fbe607672aef516a511 Signed-off-by: Idan Shaby <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetImagesListQueryBase.java 1 file changed, 1 insertion(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/29198/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetImagesListQueryBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetImagesListQueryBase.java index c7a58a9..1f9a122 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetImagesListQueryBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetImagesListQueryBase.java @@ -3,7 +3,6 @@ import java.util.List; import org.ovirt.engine.core.common.businessentities.RepoImage; -import org.ovirt.engine.core.common.errors.VdcBLLException; import org.ovirt.engine.core.common.queries.GetImagesListParametersBase; import org.ovirt.engine.core.compat.Guid; @@ -17,13 +16,7 @@ @Override protected void executeQueryCommand() { // Fetch all the Iso files of a given type for storage pool with active storage domain of this domain Id. - try { - getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); - } - catch (VdcBLLException e) { - getQueryReturnValue().setSucceeded(false); - getQueryReturnValue().setExceptionString(e.getErrorCode().toString()); - } + getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); } /** -- To view, visit http://gerrit.ovirt.org/29198 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I178783d1d57e8f8c68337fbe607672aef516a511 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Idan Shaby <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
