From c4ba00bdb3a777dea866a043820e2df89ff81f86 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 5 May 2020 22:23:11 +0200 Subject: Change exception --- .../opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt index 1276a973..f88eaed8 100644 --- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt +++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt @@ -16,10 +16,10 @@ class ReplayAllocationPolicy(val vmPlacements: Map) : Allocation image: SimpleVirtProvisioningService.ImageView ): HypervisorView? { val clusterName = vmPlacements[image.name] - ?: throw RuntimeException("Could not find placement data in VM placement file for VM ${image.name}") + ?: throw IllegalStateException("Could not find placement data in VM placement file for VM ${image.name}") val machinesInCluster = hypervisors.filter { it.server.name.contains(clusterName) } return machinesInCluster.maxBy { it.availableMemory } - ?: throw RuntimeException("Cloud not find any machines belonging to cluster $clusterName for image ${image.name}") + ?: throw IllegalStateException("Cloud not find any machines belonging to cluster $clusterName for image ${image.name}") } } } -- cgit v1.2.3