Change uninitialized throw of IllegalArgumentException from ClusterSharding.shardRegionProxy to IllegalStateException #28198 (#28205)

This commit is contained in:
Helena Edelson 2019-11-22 06:06:23 -08:00 committed by Arnout Engelen
parent d385c1098a
commit cf688444b1

View file

@ -626,7 +626,7 @@ class ClusterSharding(system: ExtendedActorSystem) extends Extension {
case null => case null =>
proxies.get(proxyName(typeName, None)) match { proxies.get(proxyName(typeName, None)) match {
case null => case null =>
throw new IllegalArgumentException(s"Shard type [$typeName] must be started first") throw new IllegalStateException(s"Shard type [$typeName] must be started first")
case ref => ref case ref => ref
} }
case ref => ref case ref => ref
@ -643,7 +643,7 @@ class ClusterSharding(system: ExtendedActorSystem) extends Extension {
def shardRegionProxy(typeName: String, dataCenter: DataCenter): ActorRef = { def shardRegionProxy(typeName: String, dataCenter: DataCenter): ActorRef = {
proxies.get(proxyName(typeName, Some(dataCenter))) match { proxies.get(proxyName(typeName, Some(dataCenter))) match {
case null => case null =>
throw new IllegalArgumentException(s"Shard type [$typeName] must be started first") throw new IllegalStateException(s"Shard type [$typeName] must be started first")
case ref => ref case ref => ref
} }
} }