From b18946d983e17db81dc78a3cf8f8938ffee7683b Mon Sep 17 00:00:00 2001 From: jojijac0b Date: Wed, 13 Nov 2024 08:37:26 -0800 Subject: [PATCH] Update exception in CreateModelRelease to properly indicate a population was not found. --- .../deploy/gcloud/spanner/writers/CreateModelRelease.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/writers/CreateModelRelease.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/writers/CreateModelRelease.kt index ba7b5f7df39..3528a94a380 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/writers/CreateModelRelease.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/writers/CreateModelRelease.kt @@ -29,6 +29,7 @@ import org.wfanet.measurement.gcloud.spanner.statement import org.wfanet.measurement.internal.kingdom.ModelRelease import org.wfanet.measurement.internal.kingdom.copy import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.ModelSuiteNotFoundException +import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.PopulationNotFoundException class CreateModelRelease(private val modelRelease: ModelRelease) : SpannerWriter() { @@ -45,7 +46,7 @@ class CreateModelRelease(private val modelRelease: ModelRelease) : val externalPopulationId = ExternalId(modelRelease.externalPopulationId) val populationData: Struct = readPopulationData(externalDataProviderId, externalPopulationId) - ?: throw ModelSuiteNotFoundException(externalDataProviderId, externalPopulationId) + ?: throw PopulationNotFoundException(externalDataProviderId, externalPopulationId) val internalModelReleaseId = idGenerator.generateInternalId() val externalModelReleaseId = idGenerator.generateExternalId()