Skip to content

Commit

Permalink
Add error message for CollectionHandle init (PolymerLabs#6690)
Browse files Browse the repository at this point in the history
Add error message for CollectionHandle init

Closes PolymerLabs#6690

COPYBARA_INTEGRATE_REVIEW=PolymerLabs#6690 from SHeimlich:collectionHandle dd7e309
PiperOrigin-RevId: 346455417
  • Loading branch information
SHeimlich authored and Scott J. Miles committed Dec 10, 2020
1 parent f1092db commit 408388c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion java/arcs/core/entity/CollectionHandle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class CollectionHandle<T : Storable, R : Referencable>(
private val storageAdapter = config.storageAdapter

init {
check(spec.containerType == HandleContainerType.Collection)
check(spec.containerType == HandleContainerType.Collection) {
"Collection containerType required for CollectionHandle $name, but got ${spec.containerType}."
}
}

// Filter out expired models.
Expand Down

0 comments on commit 408388c

Please sign in to comment.