Skip to content

Commit

Permalink
Update exception in CreateModelRelease to properly indicate a populat…
Browse files Browse the repository at this point in the history
…ion was not found.
  • Loading branch information
jojijac0b committed Nov 13, 2024
1 parent 01e8b2b commit b18946d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ModelRelease, ModelRelease>() {
Expand All @@ -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()
Expand Down

0 comments on commit b18946d

Please sign in to comment.