X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FActorContext.java;h=0aa205fa0621033e575275599c9d68c1ff2c137b;hb=a2b92b2d72c28b9913131c0340f87d2424f44108;hp=ba4d4de6bfaeed985bf1e70c626c4a3bd365a0b1;hpb=d04e0863b86415749a8437241c57df0d32a3b133;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java index ba4d4de6bf..0aa205fa06 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java @@ -13,6 +13,8 @@ import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.ActorSystem; import akka.util.Timeout; +import org.opendaylight.controller.cluster.datastore.exceptions.PrimaryNotFoundException; +import org.opendaylight.controller.cluster.datastore.exceptions.TimeoutException; import org.opendaylight.controller.cluster.datastore.messages.FindPrimary; import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound; import org.slf4j.Logger; @@ -81,7 +83,7 @@ public class ActorContext { return actorSystem.actorSelection(found.getPrimaryPath()); } - throw new RuntimeException("primary was not found"); + throw new PrimaryNotFoundException(); } /** @@ -99,7 +101,7 @@ public class ActorContext { try { return Await.result(future, AWAIT_DURATION); } catch (Exception e) { - throw new RuntimeException(e); + throw new TimeoutException(e); } } @@ -118,7 +120,7 @@ public class ActorContext { try { return Await.result(future, AWAIT_DURATION); } catch (Exception e) { - throw new RuntimeException(e); + throw new TimeoutException(e); } } @@ -131,7 +133,8 @@ public class ActorContext { * @param shardName * @param message * @param duration - * @throws java.lang.RuntimeException when a primary is not found or if the message to the remote shard fails or times out + * @throws org.opendaylight.controller.cluster.datastore.exceptions.TimeoutException if the message to the remote shard times out + * @throws org.opendaylight.controller.cluster.datastore.exceptions.PrimaryNotFoundException if the primary shard is not found * * @return */